I need a reason
#7

Benjo's way makes my compiler not respond, so i went

pawn Код:
if(strcmp("/kick", cmdtext, true, 5) == 0)
    {
            if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "RCON needed.");
            if(!strlen(cmdtext[6])) return SendClientMessage(playerid, 0xFF0000AA, "Use: /kick [playerid][reason]");
            new gp = strval(cmdtext[6]);
            if(!IsPlayerConnected(gp)) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Playerid");
            new pn[24], an[24], str[70], reason[156];
            reason = bigstrtok(cmdtext, idx);
            GetPlayerName(playerid, an, 24); GetPlayerName(gp, pn, 24);
            format(str, sizeof(str), "%s kicked by admin %s[Reason: %s]", pn, an, reason);
            SendClientMessageToAll(0xA9A9A9AA, str);
            Kick(gp);
            return 1;
    }
but got

Код:
C:\Users\Admin\Desktop\Pawn\gamemodes\new_rp.pwn(503) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Admin\Desktop\Pawn\gamemodes\new_rp.pwn(504) : error 017: undefined symbol "bigstrtok"
C:\Users\Admin\Desktop\Pawn\gamemodes\new_rp.pwn(504) : error 033: array must be indexed (variable "reason")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
0.0...
Reply


Messages In This Thread
I need a reason - by CSMajor - 13.12.2010, 00:34
Re: I need a reason - by Lynn - 13.12.2010, 01:14
Re: I need a reason - by CSMajor - 13.12.2010, 21:18
Re: I need a reason - by notime - 13.12.2010, 21:47
Re: I need a reason - by Lynn - 13.12.2010, 21:53
Re: I need a reason - by Benjo - 13.12.2010, 21:59
Re: I need a reason - by CSMajor - 14.12.2010, 00:18
Re: I need a reason - by XePloiT - 14.12.2010, 01:13
Re: I need a reason - by Steven82 - 14.12.2010, 01:15
Re: I need a reason - by [L3th4l] - 14.12.2010, 01:31

Forum Jump:


Users browsing this thread: 1 Guest(s)