26.07.2012, 15:00
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;
}