/jail command.
#1

Hello, I want make new jail cmd for admin /jail, unjail.
Params is ID TimeWithSec Reason. Please help
Reply
#2

Alright, you can make it with Pawno or Sublime Text 3.
This is help section, not request section. Show some code.
Reply
#3

Lmfao.
Just tell me how can i start and end the timer.
Idk any shit about timers
Reply
#4

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.
Reply
#5

Quote:
Originally Posted by Dayrion
View Post
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
Reply
#6

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"10000false"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;

Reply
#7

Try this tutorial it has everything you need
https://sampforum.blast.hk/showthread.php?tid=381425
Reply
#8

Quote:
Originally Posted by FuNkYTheGreat
View Post
Try this tutorial it has everything you need
https://sampforum.blast.hk/showthread.php?tid=381425
Thanks Alot


Quote:
Originally Posted by Dayrion
View Post
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"10000false"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!!! 😘
Reply
#9

Quote:
Originally Posted by oktokt1
View Post
Thanks Alot




THANK U VERY MUCH!!! 😘
You are welcome. Now if you need any help for your /jail command, post in this topic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)