SA-MP Forums Archive
dcmd - akill problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dcmd - akill problem (/showthread.php?tid=252880)



dcmd - akill problem - jonnyboy - 03.05.2011

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.");
    }
}



Re: dcmd - akill problem - jonnyboy - 03.05.2011

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.



Re: dcmd - akill problem - [S]trong - 03.05.2011

GetPlayerId function does exist


Re: dcmd - akill problem - jonnyboy - 03.05.2011

fixed it

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


Re: dcmd - akill problem - Sinner - 03.05.2011

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


Re: dcmd - akill problem - jonnyboy - 03.05.2011

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 :]