/signcheck Error Help
#1

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

Код:
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;
}
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

Код:
	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;
	}
and an admin command so that i can call a payday whenever i want

Код:
	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;
	}
Reply
#2

Correction for your /paycheck cmd:
pawn Код:
if(strcmp(cmd, "/paycheck", 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;
    }
Reply
#3

i don't see how you changed anything what did you correct?

well whatever you did fixed it thanks
Reply
#4

pawn Код:
if(strcmp(cmd, "/paycheck", true) == 0) // This line
    {
        if(PlayerInfo[playerid][pAdmin] >=1337)
        {
            SignCheck();
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not high enough admin to do this");
        } // This line
        return 1;
    }
Reply
#5

ah duh... thanks but i'm having another problem with this snipet

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;
}
it doesn't seem to store the pchecknum so that i can use my /signcheck command which looks like this

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;
    }
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)