02.10.2012, 22:51
Ok so,i started scripting the team saving for my gamemode and i have a problem.
I use the pTeam variable to save it,like:
The question now is:
How i save the team?What i should add to the OnPlayerRequestClass callback?
And after i save it,how i make the player spawn automatically after he login?This is the login part:
I use the pTeam variable to save it,like:
pawn Код:
INI_WriteInt(File,"Team",PlayerInfo[playerid][pTeam]);
How i save the team?What i should add to the OnPlayerRequestClass callback?
And after i save it,how i make the player spawn automatically after he login?This is the login part:
pawn Код:
case DIALOG_LOGIN:
{
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(playerid, PlayerInfo[playerid][pCash]);
SetPlayerScore(playerid, PlayerInfo[playerid][pKills]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"{008000}Success!","{FFFF00}You have successfully logged in!","Ok","");
Rules(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","{FF0000}You have entered an incorrect password.\n""Type your password below to login.","Login","Quit");
}
return 1;
}
}
}