03.07.2016, 16:07
Hello, I want make new jail cmd for admin /jail, unjail.
Params is ID TimeWithSec Reason. Please help
Params is ID TimeWithSec Reason. Please help
// Code ...
SetTimerEx("RespawnPlayer", 10000, false, "i", playerid);
// ^ The name of the function which timer wille execute after x seconds.
// ^ Time before the timer execut the function
// ^ If we want to repeat this (execute a function after x seconds, usefull for anti-cheat checking)
// ^ Our function called RespawnPlayer have 1 parameter : playerid and playerid is an integer so "i"
// ^ To complete the "i"
public RespawnPlayer(playerid)
{
SpawnPlayer(playerid);
return 1;
}
Try this tutorial it has everything you need
https://sampforum.blast.hk/showthread.php?tid=381425 |
Alright.
There is 2 types of timer in SA:MP. - SetTimer(funcname[], interval, repeating) - SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...) The difference between those timers is one can't take parameters (the first). How does this works? Let's respawn a player in 10 seconds after do /respawn. Copy and paste in your gamemode to see the comments. PHP Code:
|