Help me again - 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: Help me again (
/showthread.php?tid=367704)
Help me again -
DizzY2306 - 10.08.2012
Hello guys...this time im wondering how to check is player let we say stuned.So if player is stuned you wount be able to stun him again.
I did this: i made cmd that toggles your controll to off and added timer for 3 sec after 3 secs it gives you controll back again (auto untaze)
So waht im wondering is how to check is player stuned so if i /stun someone and try to /stun him again it will give me message that player is already stuned and that i cant stun him again. After 3 sec that player get scontroll back (my cmd) and then you can /stun him again.
Thanks
Re: Help me again -
thefatshizms - 10.08.2012
Use variables something like this:
pawn Код:
new Stunned[MAX_PLAYERS];
Public OnPlayerConnect(playerid)
{
Stunned[playerid] =0;//make the player not stunned when he enters the server
return 1;
}
CMD:stun(playerid, params[])
{
if(Stunned[playerid] 0)//saying if he is not stunned
{
//your code
Stunned[playerid] =1;//set him stunned
else
{
//your code if he is stunned
}
return 1;
}
Public Timer
{
Stunned[playerid] =0;//set him to not stunned
}
sorry for bad indentation etc i wrote in the forum reply thing
Re: Help me again -
DizzY2306 - 10.08.2012
Still not helping...someone else please