Help for 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 for command.. (
/showthread.php?tid=363061)
Help for command.. -
dundolina - 26.07.2012
How can I do filterscript a command can be used for example in 30 minutes? What is the code?
Re: Help for command.. -
Cjgogo - 26.07.2012
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...
Re: Help for command.. -
dundolina - 26.07.2012
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?
Re: Help for command.. -
Captain_Mani - 26.07.2012
This is the function for the timer.
https://sampwiki.blast.hk/wiki/SetTimer
Re: Help for command.. -
Alexis1999 - 26.07.2012
PHP код:
public OnGameModeInit()
{
SetTimer("action", 3000000, false);
}
Re: Help for command.. -
dundolina - 26.07.2012
Код:
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?
Re: Help for command.. -
Kakioshe22 - 26.07.2012
PHP код:
new bool:TakeJobTimer[MAX_PLAYERS];
forward JobTimer( playerid );
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.");
SendFormatMSG( playerid, -1, "Now your job is {E0941B}%s", Job[id][Name] );
P_Data[playerid][pJob] = id;
TakeJobTimer = true;
SetTimer( "JobTimer", 3000000, false );
}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
Re: Help for command.. -
dundolina - 26.07.2012
Код:
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.
Re: Help for command.. -
Kakioshe22 - 26.07.2012
My bad
PHP код:
new bool:TakeJobTimer;
forward JobTimer( playerid );
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.");
SendFormatMSG( playerid, -1, "Now your job is {E0941B}%s", Job[id][Name] );
P_Data[playerid][pJob] = id;
TakeJobTimer = true;
SetTimer( "JobTimer", 3000000, false );
}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