14.07.2010, 20:08
(
Последний раз редактировалось FrostedVince; 14.07.2010 в 20:19.
)
SetPVarInt is exactly what I needed! Thanks alot mate!
----------
EDIT:
Here I have a problem. Actually, I did a command /zombie & /human.
By typing one of these commands you will be a zombie & vice-versa.
But now, if I type /human I still can spawn as a Human even if i'm a zombie.
Here's the code:
----------
EDIT:
Here I have a problem. Actually, I did a command /zombie & /human.
By typing one of these commands you will be a zombie & vice-versa.
But now, if I type /human I still can spawn as a Human even if i'm a zombie.
Here's the code:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/zombie", cmdtext, true, 10) == 0)
{
SetPVarInt(playerid, "IsZombie", 1);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,-2768.17,-715.08,65.84);
SendClientMessage(playerid,0x0000BBAA, "Need tips? Type /zombiehelp!");
GivePlayerWeapon(playerid, 33, 150);
SetPlayerSkin( playerid, 287 );
return 1;
}
if (strcmp("/human", cmdtext, true, 10) == 0)
{
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,-2768.17,-715.08,65.84);
SendClientMessage(playerid,0x0000BBAA, "Need tips? Type /humanhelp!");
GivePlayerWeapon(playerid, 33, 150);
SetPlayerSkin( playerid, 17 );
return 1;
}
else if(GetPVarInt(playerid, "IsZombie") == 1)
{
SendClientMessage(playerid,COLOR_RED, "You are a zombie, you canno't switch!");
return 1;
}
return 0;
}