SA-MP Forums Archive
Hey all need help.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hey all need help.. (/showthread.php?tid=232082)



Hey all need help.. - trapped1 - 26.02.2011

so I wanted to create a command witch will give +1 score and save it in users file..

Here will be the error lines:
Код:
error 017: undefined symbol "COLOR_GRAY"
error 033: array must be indexed (variable "gPlayerAccount")
error 033: array must be indexed (variable "gPlayerAccount")
error 017: undefined symbol "COLOR_GRAY"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
4 Errors.
and here is the command:

Код:
if(strcmp("/giverespect", cmd, true) == 0)
    {
        {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp))
            {
                return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /giverespect [id]");
            }
            new id = strval(tmp);
            new pid = playerid;
            if(!IsPlayerConnected(id))
            {
                return SendClientMessage(playerid,COLOR_GRAY,"Server: This player is not online!");
            }
            if (PlayerInfo[id][gPlayerAccount] < 400)
            {
                new amsg[100];
                new victimid[MAX_PLAYERS];
                GetPlayerName(id, victimid, sizeof(victimid));
                format(amsg,sizeof(amsg),"Server: You have given %s one respect point!",victimid);
                SendClientMessage(pid,COLOR_LIGHTBLUE,amsg);
                PlayerInfo[id][gPlayerAccount]++;
                return 1;
            }
            else SendClientMessage(pid,COLOR_GRAY,"Server: This player already haves too many permissons (over 400)!");
        }
    }



Re: Hey all need help.. - rjjj - 26.02.2011

I did it for you

pawn Код:
if(strcmp("/giverespect", cmd, true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /giverespect [id]");
                return 1;
            }
            new id = strval(tmp);
            new pid = playerid;
            if(!IsPlayerConnected(id))
            {
                SendClientMessage(playerid,0x778899FF,"Server: This player is not online!");
                return 1;
            }
            if (PlayerInfo[id][gPlayerAccount] < 400)
            {
                new amsg[100];
                new victimid[MAX_PLAYERS];
                GetPlayerName(id, victimid, sizeof(victimid));
                format(amsg,sizeof(amsg),"Server: You have given %s one respect point!",victimid);
                SendClientMessage(pid,COLOR_LIGHTBLUE,amsg);
                PlayerInfo[id][gPlayerAccount]++;
                return 1;
            }
            else
            {
                SendClientMessage(pid,0x778899FF,"Server: This player already haves too many permissons (over 400)!");
            }
        }
        return 1;
    }
I hope that i have helped


Re: Hey all need help.. - trapped1 - 26.02.2011

thanks for your replay but errors are still there...

Quote:

error 033: array must be indexed (variable "gPlayerAccount")
error 033: array must be indexed (variable "gPlayerAccount")

I think its because I didn't make dini_inset or smth.. just don't know how... please help me about that...


Re: Hey all need help.. - Vero - 26.02.2011

Quote:
Originally Posted by trapped1
Посмотреть сообщение
thanks for your replay but errors are still there...



I think its because I didn't make dini_inset or smth.. just don't know how... please help me about that...
Have you added them like this:

pawn Код:
new gPlayerAccount;
Just a suggestion not sure though :P


Re: Hey all need help.. - trapped1 - 26.02.2011

new gPlayerAccount[MAX_PLAYERS];

Yeah all thing is done but......