[HELP] DCMD (/akill)
#1

Hi i'm trying to use DCMD for first time, but i failed :P

I'll get few errors, "undefined symbol "targetid""

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(akill, 5, cmdtext);
    return 0;
}

dcmd_akill(playerid, params[])
{
    new pName [MAX_PLAYER_NAME], tName [MAX_PLAYER_NAME], string [128];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    GetPlayerName(targetid, tName, MAX_PLAYER_NAME);
   
    new Reason;
    if(!sscanf(params,"ds", playerid, Reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /akill [playerid] [reason]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
    if(playerid) return SendClientMessage(playerid,COLOR_RED,"You can`t KILL yourself");

    format(string, sizeof(string), "ADMIN KILL: %s(%d) killed %s(%d) %d", pName, playerid, tName, targetid, reason);
    SendClientMessageToAll(COLOR_RED, string);
   
    SetPlayerHealth(targetid, 0.0);
    return 1;
}
Reply


Messages In This Thread
[HELP] DCMD (/akill) - by Larsey123IsMe - 15.01.2011, 12:51
Re: [HELP] DCMD (/akill) - by DeadAhead - 15.01.2011, 12:54
Re: [HELP] DCMD (/akill) - by Lorenc_ - 15.01.2011, 12:54
Re: [HELP] DCMD (/akill) - by DeadAhead - 15.01.2011, 12:56
Re: [HELP] DCMD (/akill) - by Larsey123IsMe - 15.01.2011, 13:43

Forum Jump:


Users browsing this thread: 7 Guest(s)