02.04.2013, 11:59
this is the Login system.
And this is on playerrequestspawn
So what do i have to do exactly?
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]);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(PlayerInfo[playerid][pTeam] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Welcome, You are Terrorist now. Keep Killing Counter Terrorists.");
SendClientMessage(playerid, COLOR_GREY, "Use /commands to vieuw all commands!");
SetSpawnInfo( playerid, 0, 294, 195.5586, 427.2332, 12.7379, 269.15, 0, 0, 0, 0, 24, 50 );
SpawnPlayer(playerid);
TogglePlayerControllable(playerid,1);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetTimerEx("Unfreeze", 5000, false, "i", RPN(playerid));
return 0;
}
else if(PlayerInfo[playerid][pTeam] == 2)
{
SendClientMessage(playerid, COLOR_BLUE, "Welcome, You are an Counter Terrorist now. Keep Killing Terrorists.");
SendClientMessage(playerid, COLOR_GREY, "Use /commands to vieuw all commands!");
SetSpawnInfo( playerid, 0, 285, 49.1121, 423.5605, 12.7379, 269.15, 0, 0, 0, 0, 24, 50 );
SpawnPlayer(playerid);
TogglePlayerControllable(playerid,1);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetTimerEx("Unfreeze", 5000, false, "i", RPN(playerid));
return 0;
}
return 1;
}