dcmd - akill problem
#1

I need help with this

i probably did something wrong with this >_<

pawn Код:
dcmd_akill(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] > 3)
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level 3 to use that command!");
        return SendClientMessage(playerid, COLOR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /akill [id | name]");
    else
    {
    new pName;
    new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(IsPlayerConnected(id) && id != playerid)
    {
        SetPlayerHealth(id, 0.0);
        new string[128];
        format(string, sizeof(string), "You have been admin-killed by administrator %s", pName);
        SendClientMessage(id, COLOR_ORANGE, string);
        format(string, sizeof(string), "You have successfully admin-killed player %s", pName);
        return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    }
    else
        return SendClientMessage(playerid, COLOR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}
Reply
#2

sorry.

forgot to write the error:

Код:
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(688) : error 017: undefined symbol "GetPlayerId"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#3

GetPlayerId function does exist
Reply
#4

fixed it

had to re-code a bit D: but now i don't even know if it will work.
Reply
#5

pawn Код:
new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
Is this correct syntax in PAWN? I never knew! (Is it?)
Reply
#6

Quote:
Originally Posted by Sinner
Посмотреть сообщение
pawn Код:
new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
Is this correct syntax in PAWN? I never knew! (Is it?)
its now

pawn Код:
new pName;
    new id;
and it works perfectly now :]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)