PlayerInfo Error
#1

I don't get what the issue is, do I need to define or include something?

pawn Code:
/* Credits to Shockey HD */
CMD:kick(playerid,params[])
    {
        if(PlayerInfo[playerid][pAdminLevel] >=1)
        {
            new id,n[MAX_PLAYER_NAME],reason[35], on[MAX_PLAYER_NAME], string[128], string2[128];
            if(sscanf(params,"uz",id, reason)) return SendClientMessage(playerid,COLOR_RED,"Usage:/kick [ID] [reason]");
            else if(playerid == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"System: Invalid ID");
            if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
            if(playerid == id) return SendClientMessage(playerid,COLOR_RED, "You cannot kick yourself");
            else
            {
            GetPlayerName(playerid,n,sizeof(n));
            GetPlayerName(id,on,sizeof(on));
            format(string,sizeof(string),"You have been kicked by Admin: %s for %s",n,reason);
            SendClientMessage(playerid,COLOR_RED,string);//
            format(string2, sizeof(string), "Admin Action: %s has kicked %s because: %s",n,on,reason);
            SendClientMessageToAll(COLOR_RED,string2);
            Kick(id);
            }
        }
        else return SendClientMessage(playerid,COLOR_RED,"  You are not allowed to use this command!");
        return 1;
}
Code:
C:\Users\new\Desktop\Server\gamemodes\rrp.pwn(330) : warning 215: expression has no effect
C:\Users\new\Desktop\Server\gamemodes\rrp.pwn(330) : error 001: expected token: ";", but found "]"
C:\Users\new\Desktop\Server\gamemodes\rrp.pwn(330) : error 029: invalid expression, assumed zero
C:\Users\new\Desktop\Server\gamemodes\rrp.pwn(330) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

what is the line 330?
Reply
#3

I do not see your error, but try this.

pawn Code:
CMD:kick(playerid,params[])
{
    new id,n[MAX_PLAYER_NAME],reason[35], on[MAX_PLAYER_NAME], string[128], string2[128];
    if(PlayerInfo[playerid][pAdminNivel] == 0) return SendClientMessage(playerid,COLOR_RED,"  You are not allowed to use this command!");
    if(sscanf(params,"uz",id, reason)) return SendClientMessage(playerid,COLOR_RED,"Usage:/kick [ID] [reason]");
    if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"System: Invalid ID");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
    if(playerid == id) return SendClientMessage(playerid,COLOR_RED, "You cannot kick yourself");
    else
    {
        GetPlayerName(playerid,n,sizeof(n));
        GetPlayerName(id,on,sizeof(on));
        format(string,sizeof(string),"You have been kicked by Admin: %s for %s",n,reason);
        SendClientMessage(playerid,COLOR_RED,string);
        format(string2, sizeof(string), "Admin Action: %s has kicked %s because: %s",n,on,reason);
        SendClientMessageToAll(COLOR_RED,string2);
        Kick(id);
    }
    return 1;
}
Only Compiled, no tested.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)