if player - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: if player (
/showthread.php?tid=334818)
if player -
oscar7610 - 16.04.2012
Hi how can I add something like if a player is not russian he cannot enter that building.
similar to this.
public OnPlayerSpawn(playerid)
{
if(IsPlayerAdmin(playerid)) SendClientMessageToAll(0xDEEE20FF, "An admin spawned.");
else SendClientMessageToAll(0xDEEE20FF, "A user spawned.");
return 1;
}
Something like "You are not authorized to enter this building"
Re: if player -
Kindred - 16.04.2012
Well, we need your variables and such. So, for example, if I have this enum:
pawn Code:
enum pInfo
{
Race,
//Rest
}
new PlayerInfo[MAX_PLAYERS][pInfo];
And apparently, you set it so russian:
race = 2.
So if race is 2, it continues. So do it like this
pawn Code:
if(PlayerInfo[playerid][Race] == 2)
{
//Enter Building
}
else if(Player..... // And so forth