12.02.2012, 23:34
I would recommend you modify it a little bit if you're going to use OnPlayerSpawn, something like....
pawn Код:
new bool:FirstSpawn[MAX_PLAYERS]; //This would be outside of everything
/*
Inside of the registration code, add FirstSpawn[playerid] = true;
Inside of OnPlayerConnect i would also add FirstSpawn[playerid] = false;
This way when they register, it's going to be true, when they are already registered,
it won't be true
*/
public OnPlayerSpawn(playerid)
{
if(FirstSpawn[playerid] == true) SetTimerEx("RegisterCash", 60000, false, "i", playerid); //Sets a timer for "Register Cash" at 1 minute and does not repeat itself and stores their playerid.
return 1;
}
forward RegisterCash(playerid);
public RegisterCash(playerid)
{
GivePlayerMoney(playerid, 100);
FirstSpawn[playerid] = false; //EDIT: forgot this lol
return SendClientMessage(playerid, -1, "{FFFFFF}You have been given $100 as a gift!");
}