SA-MP Forums Archive
Please Help Me ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please Help Me ? (/showthread.php?tid=316693)



Please Help Me ? - Mr.Fames - 08.02.2012

hey guys i got tired of fixing this and no luck when i am getting into the server after the register dialog the login dialog appears behind the login dialog is the class selection area now i can't choose any class because i need to be logged in but when i log in it kicks me instantley so please any solutions for this problem


Re: Please Help Me ? - T0pAz - 08.02.2012

Use SetSpawnInfo.


Re: Please Help Me ? - Mr.Fames - 08.02.2012

i think the problem is in my OnDialogResponse code can u guys pls check it here is the code
pawn Код:
if(dialogid == 7001) // Login
    {
        if(response == 0)
        {
        SendClientMessage(playerid, COLOR_YELLOW, "(INFO) You have {FF0000}canceled{FFEE00} the authentification process.");
        Kick(playerid);
        return 1;
        }

        if (CanLogin[playerid] == 0 && FirstSpawn[playerid] == 0) return SystemMsg(playerid, "You need to enter the class selection menu before logging on.");

        if (udb_CheckLogin(PlayerName(playerid),inputtext)) {
       
        new tmp4[256];
        new playername[MAX_PLAYER_NAME];

        GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("Money")-GetPlayerMoney(playerid));

        SetPlayerPos(playerid,
        float(dUserINT(PlayerName(playerid)).("X")),
        float(dUserINT(PlayerName(playerid)).("Y")),
        float(dUserINT(PlayerName(playerid)).("Z")));
        SetPlayerInterior(playerid,dUserINT(PlayerName(playerid)).("Interior")-GetPlayerInterior(playerid));
        SetPlayerVirtualWorld(playerid,dUserINT(PlayerName(playerid)).("WorldID")-GetPlayerVirtualWorld(playerid));

        tmp4 = dini_Get(udb_encode(playername), "bank");
        new PLAYERIP[16];
        GetPlayerIp(playerid, PLAYERIP, sizeof(PLAYERIP));
        format(prpstring, sizeof(prpstring), "(SSINFO) (LOGIN) %s (ID:%d) - (IP:%s).", playername, playerid, PLAYERIP);
        SendMessageToStaff_L4S(prpstring);
        TogglePlayerControllable(playerid,1);
        SetPlayerColor(playerid,COLOR_GREY);
        SetCameraBehindPlayer(playerid);
        SpawnPlayer(playerid);
        SetPlayerArmour(playerid,0);
        PLAYERLIST_authed[playerid]=true;
        CanLogin[playerid] = 0;
        SendClientMessage(playerid, COLOR_YELLOW, "(INFO) Welcome to the GEM - GTAEmergencyMods.net server.");
        SendClientMessage(playerid, COLOR_GREY, "To contact Admins, type /report [message].");
        SetPlayerVirtualWorld(playerid, 0);

       return SendClientMessage(playerid,COLOR_YELLOW,"(INFO) You are now logged in.");
    }else{
    SendClientMessage(playerid,COLOR_BRIGHTRED,""#COL_YELLOW"(INFO) "#COL_BRIGHTRED"The password you have submitted is incorrect.");
    format(prpstring, sizeof(prpstring), "{FAFAFA}Username: {FF0000}%s\n{FAFAFA}Enter your {FF0000}password {FAFAFA}below to login", pname);
    ShowPlayerDialog(playerid,7001,DIALOG_STYLE_INPUT,"Login into your account",prpstring,"Login","Leave");
    }
    return true;
 }
   
return 0;
}



Re: Please Help Me ? - T0pAz - 08.02.2012

Download this library and include it on your gamemode.


Re: Please Help Me ? - Mr.Fames - 08.02.2012

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Download this library and include it on your gamemode.
the section i provided doesnt return any warning or errors when i compile it but i think it is written badly


Re: Please Help Me ? - T0pAz - 08.02.2012

Quote:
Originally Posted by Mr.Fames
Посмотреть сообщение
the section i provided doesnt return any warning or errors when i compile it but i think it is written badly
Just do as I said.


Re: Please Help Me ? - Mr.Fames - 08.02.2012

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Just do as I said.
i did but now it gives me the error that OnPlayerUpdate is already defined


Re: Please Help Me ? - T0pAz - 08.02.2012

Quote:
Originally Posted by Mr.Fames
Посмотреть сообщение
i did but now it gives me the error that OnPlayerUpdate is already defined
Search OnPlayerUpdate on your script and remove it excluding the callback public OnPlayerUpdate(playerid).


Re: Please Help Me ? - Mr.Fames - 08.02.2012

guys ToPaz couldn't help me pls i need helpers


Re : Please Help Me ? - ricardo178 - 08.02.2012

Post OnPlayerConnect and OnPlayerSpawn code.
You are probably making it show the dialog in the wrong public..