/jail 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: /jail command. (
/showthread.php?tid=611209)
/jail command. -
oktokt1 - 03.07.2016
Hello, I want make new jail cmd for admin /jail, unjail.
Params is ID TimeWithSec Reason. Please help
Re: /jail command. -
Dayrion - 03.07.2016
Alright, you can make it with Pawno or Sublime Text 3.
This is help section, not request section. Show some code.
Re: /jail command. -
oktokt1 - 03.07.2016
Lmfao.
Just tell me how can i start and end the timer.
Idk any shit about timers
Re: /jail command. -
Dayrion - 03.07.2016
So this is the moment to start learning about timers?
Make a command with perma jail a player. You don't need timer.
After this, we will see for timers.
Re: /jail command. -
oktokt1 - 03.07.2016
Quote:
Originally Posted by Dayrion
So this is the moment to start learning about timers?
Make a command with perma jail a player. You don't need timer.
After this, we will see for timers.
|
Ok i will. can u tell me what should i learn to use timer?
Functions, 1 Example
Re: /jail command. -
Dayrion - 03.07.2016
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:
// 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;
}
Re: /jail command. -
FuNkYTheGreat - 03.07.2016
Try this tutorial it has everything you need
https://sampforum.blast.hk/showthread.php?tid=381425
Re: /jail command. -
oktokt1 - 03.07.2016
Quote:
Originally Posted by FuNkYTheGreat
|
Thanks Alot
Quote:
Originally Posted by Dayrion
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:
// 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;
}
|
THANK U VERY MUCH!!! 😘
Re: /jail command. -
Dayrion - 03.07.2016
Quote:
Originally Posted by oktokt1
Thanks Alot
THANK U VERY MUCH!!! 😘
|
You are welcome. Now if you need any help for your /jail command, post in this topic.