Help for command..
#1

How can I do filterscript a command can be used for example in 30 minutes? What is the code?
Reply
#2

FILTERSCRIPTS,wtf,you can do script the piece of code and add it directly to your gamemode,AND WHY would you use more than 16 filterscripts.Make a timer of 30 minutes,if the timer is running,the player cannot use the command...
Reply
#3

OMFG..I'm looking for code for the TIMER. I have so many scripts, why can not I type them in gamemode, not in my forces, stupid right? HELP?
Reply
#4

This is the function for the timer.

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#5

PHP код:
public OnGameModeInit()
{
    
SetTimer("action"3000000false); 
 } 
Reply
#6

Код:
YCMD:takejob(playerid,params[],help)
{
#pragma unused help
#pragma unused params
new id = GetJobID(playerid);
if(id == -1) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no any job.");
if(P_Data[playerid][pJob] != 0) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"You already have job.");
SendFormatMSG(playerid,-1,"Now your job is {E0941B}%s",Job[id][Name]);
P_Data[playerid][pJob] = id;
return 1;
}

How to create this for 30 minutes?
Reply
#7

PHP код:
new bool:TakeJobTimer[MAX_PLAYERS];
forward JobTimerplayerid );
YCMD:takejob(playerid,params[],help)
{
if(!
TakeJobTimer)
{
#pragma unused help
#pragma unused params
new id GetJobID(playerid);
if(
id == -1) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no any job.");
if( 
P_Data[playerid][pJob] != 0) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"You already have job.");
SendFormatMSGplayerid, -1"Now your job is {E0941B}%s"Job[id][Name] );
P_Data[playerid][pJob] = id;
TakeJobTimer true;
SetTimer"JobTimer"3000000false );
}else return 
SendClientMessage(playerid, -1"You must wait 30 minutes before doing another job again!");
return 
1;
}
public 
JobTimer(playerid)
{
   
TakeJobTimer false;
   return 
1;

If i helped you np
Reply
#8

Код:
C:\Users\ники\Desktop\IG_Job_Maker.pwn(489) : error 033: array must be indexed (variable "TakeJobTimer")
C:\Users\ники\Desktop\IG_Job_Maker.pwn(506) : error 033: array must be indexed (variable "TakeJobTimer")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#9

My bad

PHP код:
new bool:TakeJobTimer;
forward JobTimerplayerid );
YCMD:takejob(playerid,params[],help)
{
if(!
TakeJobTimer)
{
#pragma unused help
#pragma unused params
new id GetJobID(playerid);
if(
id == -1) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no any job.");
if( 
P_Data[playerid][pJob] != 0) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"You already have job.");
SendFormatMSGplayerid, -1"Now your job is {E0941B}%s"Job[id][Name] );
P_Data[playerid][pJob] = id;
TakeJobTimer true;
SetTimer"JobTimer"3000000false );
}else return 
SendClientMessage(playerid, -1"You must wait 30 minutes before doing another job again!");
return 
1;
}
public 
JobTimer(playerid)
{
   
TakeJobTimer false;
   return 
1;

If i helped you np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)