24.09.2016, 21:45
I'm doing something in which doing instructions for players when they first spawn in the server I've found a method around the forums using PVars heres the code..
Heres the thing the first/second case works but after that it doesnt random spawn the player i'm trying to do it in a way the 3 time the player dies it they wont see "First Spawn 2" again i've try putting SetPVarInt(playerid,"FirstSpawn",3); onplayerdeath but it ignores case 1... Please show me what's wrong
PHP код:
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid, 0);
if(GetTeam{playerid} == CLASS_DRIVER)
{
switch(GetPVarInt(playerid, "FirstSpawn"))
{
case 0:
{
new Random = ...
SetPlayerColor(playerid, COLOR_WHITE);
(...)//Random Spawn
SetPVarInt(playerid, "FirstSpawn", 1);
SendClientMessage(playerid, -1, "First Spawn 1.");
}
case 1:
{
new Random = ....
SetPlayerColor(playerid, COLOR_WHITE);
(...)//Random Spawn
SendClientMessage(playerid, -1, "First Spawn 2.");
SetPVarInt(playerid, "FirstSpawn", 2);
}
}
}
return 1;
}