menu -
nuriel8833 - 25.07.2009
i have a menu:
pawn Код:
if (strcmp(cmd, "/v4", true) == 0)
{
ShowMenuForPlayer(ActivitisStadiumcars, playerid);
TogglePlayerControllable(playerid, 0);
return 1;
}
how can i do that if player is choosing something in the 2nd-5th time it will "freeze" him for a 5 second and after that he will be unfrozen
if player is choosing something in the 5th time it will send him a messange and delete what he choose?
tanks for helping
Re: menu -
abhinavdabral - 25.07.2009
You can use this after checking that player has used it 2n time or whenever you want
pawn Код:
// Inside where you check that player has choosed it 2nd-5th time
TogglePlayerControllable(playerid,0);
SetTimerEx("UnFreeze",5000,0,"i",playerid);
/// Add this at last of the script
forward UnFreeze(playerid);
public UnFreeze(playerid){
TogglePlayerControllable(playerid,1);
}
Re: menu -
SpiderPork - 25.07.2009
Quote:
Originally Posted by ۞●•λвнiиаv•●۞
You can use this after checking that player has used it 2n time or whenever you want
pawn Код:
// Inside where you check that player has choosed it 2nd-5th time TogglePlayerControllable(playerid,0); SetTimer("UnFreeze",5000,0,"i",playerid);
/// Add this at last of the script
forward UnFreeze(playerid); public UnFreeze(playerid){ TogglePlayerControllable(playerid,1); }
|
SetTimer will only work for ID 0. Use SetTimerEx...
Re: menu -
abhinavdabral - 25.07.2009
Edited .. thanks for telling Spider ...
Thank You
-Abhinav
Re: menu -
nuriel8833 - 25.07.2009
i ment of he chose something afther that he chose already is it gonna make him wait 5 second?
Re: menu -
abhinavdabral - 25.07.2009
just add a boolean variable for that. Use a boolean veriable inside the timer and set it to
false and
before setting the timer, set it to
true
Inside you OnMenuSelectRow ...
check if that boolean variable is
true, only then the player can perform that fuction.
Re: menu -
nuriel8833 - 25.07.2009
Quote:
Originally Posted by ۞●•λвнiиаv•●۞
just add a boolean variable for that. Use a boolean veriable inside the timer and set it to false and
before setting the timer, set it to true
Inside you OnMenuSelectRow ...
check if that boolean variable is true, only then the player can perform that fuction.
|
huhhhhhhhhhhh/
explain more
Re: menu -
abhinavdabral - 26.07.2009
Add this on the top of the script
pawn Код:
new bool:AllowMenu[MAX_PLAYERS]=true;
forward CheckAllow(playerid);
Now add this inside where you select something for the first time ...after where you have selected then add this line
pawn Код:
new bool:AllowMenu[playerid]=false;
SetTimerEx("CheckAllow",5000,0,"i",playerid);
Add at the same place but before everything to check whether is the player accessing the command again.
pawn Код:
if(!AllowMenu[playerid]) return SendClientMessage(playerid,0xFF0000FF,"You are accessing it too fast, slow down !");
and add this at the bottom of the script
pawn Код:
public CheckAllow(playerid){
AllowMenu[playerid]=true;
}
Now add this under OnPlayerConnect
pawn Код:
AllowMenu[playerid]=true;
I am 70% sure that you are confused seeing this...but in real its damn easy :P
Good Luck with this
Thank You
-Abhinav
Re: menu -
nuriel8833 - 26.07.2009
Quote:
Originally Posted by ۞●•λвнiиаv•●۞
Add this on the top of the script
pawn Код:
new bool:AllowMenu[MAX_PLAYERS]=true; forward CheckAllow(playerid);
Now add this inside where you select something for the first time ...after where you have selected then add this line
pawn Код:
new bool:AllowMenu[playerid]=false; SetTimerEx("CheckAllow",5000,0,"i",playerid);
Add at the same place but before everything to check whether is the player accessing the command again.
pawn Код:
if(!AllowMenu[playerid]) return SendClientMessage(playerid,0xFF0000FF,"You are accessing it too fast, slow down !");
and add this at the bottom of the script
pawn Код:
public CheckAllow(playerid){ AllowMenu[playerid]=true; }
Now add this under OnPlayerConnect
pawn Код:
AllowMenu[playerid]=true;
I am 70% sure that you are confused seeing this...but in real its damn easy :P
Good Luck with this
Thank You
-Abhinav
|
ok i will check it later
Re: menu -
nuriel8833 - 26.07.2009
but how can i do that if he is choosing thing like 5 times it wont let him?