Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Spawn without clicking "SPAWN" button

$
0
0
Hi guys,
I have 2 problems in my reg/log system..
When someone register after that spawn button dont show, so he need relog if he wants play on server
Second problem is that when someone logging in he need first press "Login" button then Spawn,
How i can fix it, thanks in advance to all :)
PHP Code:

public OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid208.4068143.88431003.0234);
    
    return 
1;


PHP Code:

public OnPlayerConnect(playerid)
{
    
uduelu[playerid] = 0;
    
dopustenduel[playerid] = 1;
    
//////REG/LOG
    
if(fexist(UserPath(playerid)))
    {
        
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
          
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""guenatroy"LOGIN",""COL_WHITE"Dobro dosli nazad na {0080C0}RB Arena DeathMatch\n{FFFFFF}Imate {0080C0}60 {FFFFFF}sekundi da upisete svoju lozinku ili ce te biti {F81414}kickovani.\n{FFFFFF}Uzivajte u igri i igrajte posteno.","Login","Izlaz");
          
TextDrawShowForPlayer(playeridRegLog[0]); TextDrawShowForPlayer(playeridRegLog[1]);
          
InterpolateCameraPos(playerid575.325988, -1244.65612725.845386735.324829, -1128.91687073.6618727777);
        
InterpolateCameraLookAt(playerid571.176696, -1247.41210926.278436733.528747, -1124.68786671.6896207777);
        
SetPlayerSkin(playerid29);
    }
    else
    {
         
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT,""guenatroy"REGISTER",""COL_WHITE"Dobro dosli {0080C0}Novi igrac\n{FFFFFF}Ovo je {0080C0}RB Arena DeathMatch server.\n{FFFFFF}U prazno polje upisite vasu zeljenu lozinku te se registruje.\nImate {0080C0}60 {FFFFFF}sekundi da upisete svoju lozinku ili ce te biti {F81414}kickovani.  ","Register","Izlaz");
    }
    
/////////////
    
PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/9p0t9tp8zd/Las_Vegas_-_Let_it_ride_-_Charlie_Clouser.mp3");
    
InDM[playerid] = 0;
    
OcistiChat(playerid,16);
    
SCM(playerid, -1""BJELA"Ucitavanje podataka na nasem serveru.");
    
SCM(playerid, -1""BJELA"KAKP BISTE SE SPAWNOVALI PRITISNITE (SPAWN)");
    return 
1;


PHP Code:

public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch( 
dialogid )
    {
        case 
DIALOG_REGISTER:
        {
            if (!
response) return Kick(playerid);
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""guenatroy"REGISTRACIJA",""COL_RED"Unjeli ste pogresan password.\n"COL_WHITE"Unesite normalan password da se registrirate.","Register","Izlaz");
                
InterpolateCameraPos(playerid575.325988, -1244.65612725.845386735.324829, -1128.91687073.6618727777);
                
InterpolateCameraLookAt(playerid571.176696, -1247.41210926.278436733.528747, -1124.68786671.6896207777);
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Cash",0);
                
INI_WriteInt(File,"Admin",0);
                
INI_WriteInt(File,"Kill",0);
                
INI_WriteInt(File,"Death",0);
                
INI_WriteInt(File,"Skin"24);
                
INI_Close(File);
                
SetSpawnInfo(playerid0241958.331343.1215.36269.15000000);
                
SpawnPlayer(playerid);
                
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
                
SetPlayerPos(playerid1710.433715,-1669.379272,20.225049);
                
SetPlayerInterior(playerid18);
            }
        }
        case 
DIALOG_LOGIN:
        {
            
InterpolateCameraPos(playerid575.325988, -1244.65612725.845386735.324829, -1128.91687073.6618727777);
            
InterpolateCameraLookAt(playerid571.176696, -1247.41210926.278436733.528747, -1124.68786671.6896207777);
            if ( !
response ) return Kick playerid );
            if( 
response )
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
GivePlayerMoney(playeridPlayerInfo[playerid][pCash]);
                    
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
                    
SetPlayerPos(playerid1710.433715,-1669.379272,20.225049);
                    
SetPlayerInterior(playerid18);
                }
                else
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""guenatroy"LOGIN",""COL_RED"Nazalost ste unjeli pogresan password.\n"COL_WHITE"Upisite sifru kako treba za pristup..","Login","Izlaz");
                }
            }
        }
           case 
dueldialog +1:
        {
                if(!
response) return tijek 0;
                
tipduela listitem;
                
DuelOffered();
        }
        case 
dueldialog +2:
        {
            if(!
response) return DuelDeclined();
              
SetPlayerPos(duel1mjestoduel1);
               
SetPlayerFacingAngle(duel14.5954);
               
SetCameraBehindPlayer(duel1);
               
SetPlayerPos(duel2mjestoduel2);
            
SetPlayerFacingAngle(duel2188.0179);
            
SetCameraBehindPlayer(duel2);
            
SetPlayerHealth(duel2100);
            
SetPlayerHealth(duel1100);
            
SetPlayerArmour(duel2100);
            
SetPlayerArmour(duel1100);
            
tijek 2;
            
SetPlayerInterior(duel10);
            
SetPlayerInterior(duel20);
            new 
string[128];
            
format(stringsizeof(string), "{ff0000}[DUEL] {ffffff}Duel izmedju %s(%d) i %s(%d) je poceo. (Ulog: %d)"PlayerName(duel1), duel1PlayerName(duel2), duel2Ulog);
            
SendClientMessageToAll(-1string);
            
TogglePlayerControllable(duel1false);
            
TogglePlayerControllable(duel2false);
            
uduelu[duel1] = 1;
            
uduelu[duel2] = 1;
            
GiveDuelWeapons(tipduela);
            
CD 6;
            
CDTimer SetTimer("CountDown"10001);
            
KillTimer(dueltajmer);
            
DUEL_TIMER SetTimer("TIMEUP"60000*30);
        }
    }
    return 
1;
}
public 
OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    return 
1;


ps. Thanks to all in advance, you always fixing my problems with script, i love you guys <3 :)

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>