19.03.2011, 19:26
ah duh... thanks but i'm having another problem with this snipet
it doesn't seem to store the pchecknum so that i can use my /signcheck command which looks like this
i think i've narrowed the problem down to where my signcheck function doesn't store the random check number to PlayerInfo. So i created another value which is the PayCheckNum[MAX_PLAYERS] but it still doesn't work.
pawn Код:
public SignCheck()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
new randcheck = 1000 + random(8999);//minimum 1000 max 9999 //giving one at the start
PlayerInfo[i][pCheckNum] = randcheck;
PlayerInfo[i][pPayPaid] = 0;
PayCheckNum[i] = randcheck;
new entry[200];
format(entry, sizeof(entry), "PAYDAY: Do /signcheck %i", randcheck);
SendClientMessage(i, COLOR_LIGHTBLUE, entry);
}
SetTimer("LateCheck", 300000, false);
return 1;
}
pawn Код:
if(strcmp(cmd, "/signcheck", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /signcheck [Check #]");
return 1;
}
new Check;
Check = strval(tmp);
if(Check == PayCheckNum[playerid])
{
if(PlayerInfo[playerid][pPayPaid] == 0)
{
PayDay();
}
else
{
SendClientMessage(playerid, COLOR_GREY, "The bank won't accept that check your too late");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "That isn't the correct Check number");
}
}
return 1;
}