[HELP] Give Timer For Using Command - 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] Give Timer For Using Command (
/showthread.php?tid=534140)
[HELP] Give Timer For Using Command -
FloxX - 28.08.2014
[HELP]
How to create Timer On Using command
This my code
//Pick Ammo
CMD
ickammo(playerid,params[])
{
for(new i= 0; i < sizeof(pickup_Box); i++)
{
new Float
,Float: y,Float: z;
new weapons[13][2];
GetPlayerWeaponData( playerid, i, weapons[i][0], weapons[i][1] );
SetPlayerAmmo( playerid, i, weapons[i][1] + ( 5 + random( 500 ) ) );
GetObjectPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, x, y ,z, 10.0)) { SendClientMessage( playerid, -1, "Anda dekat dengan objek Pick_Box!" ); }
}
return 1;
}
Please Help Me
Thanks
No Ones Help o.O
?
Re: [HELP] Give Timer For Using Command -
Dotayuri - 28.08.2014
Could you tell me more about what you want?
A timer yes, but where and for what?
Re: [HELP] Give Timer For Using Command -
Beckett - 28.08.2014
There's an easier method but I really not sure if it works or not so I'll use the old method.
Set a variable when the command is processed to TRUE. (PS: Make sure the variable is for MAX_PLAYERS)
After that set the timer you'd like for the player to proccess the command again.
When the timer ends set the variable for the player to FALSE.
If you would like an example feel free to tell me.