19.03.2011, 07:27
I'm trying to design a /signcheck instead of just insta paydays i coded this and got a bunch of errors saying '"safeGivePlayerMoney" was not implemented' like 23 of those errors and i think i vaguely remember that's because i'm missing a bracket or something? well here's my code see if you can figure out whats wrong with it
there is what i call instead of Payday(); and i switch SignCheck(); with PayDay(); in the SyncTime() callback
of course i forwarded both of those new functions looks like this
forward SignCheck();
forward LateCheck();
then i added the command
and an admin command so that i can call a payday whenever i want
Код:
public SignCheck() { for(new i=0; i<MAX_PLAYERS; i++) { new randcheck = 100000 + random(899999);//minimum 1000 max 9999 //giving one at the start PlayerInfo[i][pCheckNum] = randcheck; PlayerInfo[i][pPayPaid] = 0; new entry[200]; format(entry, sizeof(entry), "PAYDAY: Do /signcheck %i", randcheck); SendClientMessage(i, COLOR_LIGHTBLUE, entry); } SetTimer("LateCheck", 300000, false); return 1; } public LateCheck() { for(new i=0; i<MAX_PLAYERS; i++) { PlayerInfo[i][pPayPaid] = 1; } return 1; }
of course i forwarded both of those new functions looks like this
forward SignCheck();
forward LateCheck();
then i added the command
Код:
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; } if(strval(tmp) == PlayerInfo[playerid][pCheckNum]) { 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; }
Код:
if(strcmp(cmd, "/paycheck", true) == 0, true) == 0) // by:Qeux { if(PlayerInfo[playerid][pAdmin] >=1337) { SignCheck(); } else { SendClientMessage(playerid, COLOR_GREY, "You are not high enough admin to do this"); { return 1; }