Confused with command.
#1

Hi,


For every user in my game in the it user file it has a line saying' Council_Staff 0/1 with 0 bieng not staff and 1 being staff, I've also made a command which is called /makeadmin and it changes the user who is using that command from 'Council_Staff 0' to 'Council_Staff 1'. That command works fine but I've now created a command for kick and it has to check in the file for the Council_Staff 1 otherwise it wont let them do it. And i don't have a clue how i can make it check their file for that line and let them use the command otherwise show them my error message.

Below is my command & I'd be grateful if anyone could help me with this code.

pawn Код:
dcmd_kick(playerid, params[])
{
    if(Council_Staff[playerid] ==1)
        {
        new id,reason[256];
        if (!sscanf(params, "ds", id,reason)) SendClientMessage(playerid, 0xFF0000FF, "[BMDC] Usage: /kick [ID] [REASON]");
        else if (IsPlayerConnected(playerid))
            {
            new tmp[256];
            format(tmp,256,"[KICK] %s(%d) got kicked from the server: %s",PlayerName(id),id,reason);
            SendClientMessageToAll(COLOR_ORANGE,tmp);
            Kick(id);
            dini_IntSet("banlog",tmp,1);
            print(tmp);
            }
        else
            {
            SendClientMessage(playerid, 0xFF0000FF, "[BMDC] Invalid ID");
            }
        }
    return 1;
}
Then i get the following messages
Код:
C:\Users\Ashley\Desktop\samp02Xserver.win32[1]\gamemodes\RP.pwn(4620) : error 017: undefined symbol "Council_Staff"
C:\Users\Ashley\Desktop\samp02Xserver.win32[1]\gamemodes\RP.pwn(4620) : warning 215: expression has no effect
C:\Users\Ashley\Desktop\samp02Xserver.win32[1]\gamemodes\RP.pwn(4620) : error 001: expected token: ";", but found "]"
C:\Users\Ashley\Desktop\samp02Xserver.win32[1]\gamemodes\RP.pwn(4620) : error 029: invalid expression, assumed zero
C:\Users\Ashley\Desktop\samp02Xserver.win32[1]\gamemodes\RP.pwn(4620) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line 4620 is:
pawn Код:
if(Council_Staff[playerid] ==1)

Any ideas on how i can sort this command out?


Ashley
Reply


Messages In This Thread
Confused with command. - by Ashley - 24.03.2009, 15:57
Re: Confused with command. - by NtCat - 24.03.2009, 16:16
Re: Confused with command. - by Ashley - 24.03.2009, 16:31
Re: Confused with command. - by NtCat - 24.03.2009, 16:39
Re: Confused with command. - by Ashley - 24.03.2009, 17:11
Re: Confused with command. - by Rks25 - 24.03.2009, 18:04
Re: Confused with command. - by Ashley - 24.03.2009, 18:37
Re: Confused with command. - by Rks25 - 24.03.2009, 18:40
Re: Confused with command. - by Ashley - 24.03.2009, 19:22
Re: Confused with command. - by Rks25 - 24.03.2009, 19:47

Forum Jump:


Users browsing this thread: 2 Guest(s)