Hey all need help..
#1

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)!");
        }
    }
Reply
#2

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
Reply
#3

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...
Reply
#4

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
Reply
#5

new gPlayerAccount[MAX_PLAYERS];

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


Forum Jump:


Users browsing this thread: 1 Guest(s)