check 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: check if player (
/showthread.php?tid=476891)
check if player -
Gafsi - 21.11.2013
hello guys how can i check if player is muted or forzen or jailed etc!
Re: check if player -
DarkLored - 21.11.2013
Here is something that can help you
pawn Код:
if(GetPVarInt(playerid,"Jailed") == 1)
{
//Your Code Here
return 1;
}
Re: check if player -
Brandon_More - 21.11.2013
pawn Код:
if(PlayerInfo[playerid][muted] > 0)
{
// return what you want here....
return 1;
}
pawn Код:
if(muted[playerid] > 0)
{
// return what you want here....
return 1;
}
pawn Код:
if(GetPVarInt(playerid,"muted") == 1)
{
// return what you want here....
return 1;
}
Re: check if player -
xFallen - 21.11.2013
Код:
if(PlayerInfo[playerid][muted] == 1) // This line checks if the player is muted if so it does something.
{
// this what it will return if the player is muted.
return 1;
}
if(PlayerInfo[playerid][injail] == 1) // This line checks if the player is in jail if so it does something.
{
// this what it will return if the player is muted.
return 1;
}
if(PlayerInfo[playerid][frozen] == 1) // This line checks if the player is frozen if so it does something.
{
// this what it will return if the player is muted.
return 1;
}
For example:
Код:
if(PlayerInfo[playerid][injail] == 1) // We have cheked that the player is in prison.
{
SendClientMessage(playerid, RED, "You can't use that command in jail"); // After we found out he is in prison we tell him that the command he is using is forrbiden in prison.
return 1;
}
Re: check if player -
iJumbo - 21.11.2013
Depend on wich code are you based
Re: check if player -
xFallen - 21.11.2013
Quote:
Originally Posted by iJumbo
Depend on wich code are you based
|
Correct, dont forget to add those stats in your 'PlayerInfo'.
Or else, check how they are called in your PlayerInfo stats.