CMD:signcheck(playerid, params[]) { new randcn = 10000 + random(999999); if(sscanf(params, "d", randcn)) return SendClientMessage(playerid, -1, "USAGE: /signcheck [number]"); { if(CheckReady[playerid] == 1) { if(IsPlayerInRangeOfPoint(playerid, 4.0, 915.9413,2370.7383,246.4621)) { PayDayCheck(playerid); CheckReady[playerid] = 0; } else return SendClientMessage(playerid, COLOR_WHITE, "You have entered an invalid check number!"); } else return SendClientMessage(playerid, COLOR_WHITE, "Your check isn't ready to be collected."); } return 1; }
public ClockUpdate() { for(new x = 0; x < MAX_PLAYERS; x++) { if(Logged[x] == 1) { new string[12]; new string1[12]; new randcn = 10000 + random(999999); Second += 1; format(string, sizeof(string), "%i:%i:%i", Hour, Minute, Second); if(Second == 60) { if(Minute == 59) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SendClientMessage(i, COLOR_ORANGE, "Payday! Your check has arrived, head to the post office in Fort Carson!."); CheckReady[i] = 1; format(string1,sizeof (string1),"Payday: %d", randcn); TextDrawSetString(Payday, string1); TextDrawShowForAll(Payday); } } if(Hour == 23) { Hour = 0; Minute = 0; Second = 0; } else { Hour ++; Minute = 0; Second = 0; } } else { Minute ++; Second = 0; } } format(string,sizeof (string),"%02i:%02i:%02i", Hour, Minute, Second); TextDrawSetString(Clock, string); SetWorldTime(Hour); } } return 1; }
// Somewhere at the top of your gamemode
new randcn;
// CMD
CMD:signcheck(playerid, params[])
{
new inputnum;
if(!sscanf(params, "d", inputnum))
{
if(inputnum == randcn)
{
if(CheckReady[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, 915.9413,2370.7383,246.4621))
{
PayDayCheck(playerid);
CheckReady[playerid] = 0;
} else return SendClientMessage(playerid, COLOR_WHITE, "You are not at the location to get your payday.");
} else return SendClientMessage(playerid, COLOR_WHITE, "Your check isn't ready to be collected.");
} else return SendClientMessage(playerid, COLOR_WHITE, "You inserted the wrong number.");
} else return SendClientMessage(playerid, -1, "USAGE: /signcheck [number]");
return 1;
}
public ClockUpdate()
{
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(Logged[x] == 1)
{
new string[12];
new string1[12];
Second += 1;
format(string, sizeof(string), "%i:%i:%i", Hour, Minute, Second);
if(Second == 60)
{
if(Minute == 59)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
randcn = 10000 + random(999999);
SendClientMessage(i, COLOR_ORANGE, "Payday! Your check has arrived, head to the post office in Fort Carson!.");
CheckReady[i] = 1;
format(string1,sizeof (string1),"Payday: %d", randcn);
TextDrawSetString(Payday, string1);
TextDrawShowForAll(Payday);
}
}
if(Hour == 23)
{
Hour = 0;
Minute = 0;
Second = 0;
}
else
{
Hour ++;
Minute = 0;
Second = 0;
}
}
else
{
Minute ++;
Second = 0;
}
}
format(string,sizeof (string),"%02i:%02i:%02i", Hour, Minute, Second);
TextDrawSetString(Clock, string);
SetWorldTime(Hour);
}
}
return 1;
}
pawn Код:
with: pawn Код:
If you wan't it to work with more players you should edit, randcn to a player variable, and also edit the textdraw to a player textdraw. |