Admin command problem
#1

Hey, again!
So, I know something is wrong with this, even tho the compile was clean, cuz when i started the local host, it said file or function not found.. After I added this cmd, so help would be great.

pawn Код:
COMMAND:killplayer(playerid, params[])
    {
    new id;
    if(IsPlayerAdmin(playerid))
        {
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /killplayer <ID>");
        SetPlayerHealth(id, -1);
        SendClientMessage(id, COLOR_RED, "You have been killed by an Admin!");
        SendClientMessage(playerid, COLOR_RED, "Player killed!");
        }else{
        SendClientMessage(playerid, COLOR_RED, "You're not an admin!");
        }
    return 1;
    }
So, this is probably WAY off track, but please help me get my train back ON track, (lol?) Thank you in acvance.
Reply
#2

pawn Код:
COMMAND:killplayer(playerid, params[])
{
    if(IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You're not an admin!");
    else
    {
        new ID;
        if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_RED, "USAGE: /killplayer <ID>");
        else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_RED, "Player is not connected");
        else
        {
            SendClientMessage(ID, COLOR_RED, "You have been killed by an Admin!");
            SetPlayerHealth(ID, 0);
            SendClientMessage(playerid, COLOR_RED, "Player killed!");
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Clive
Посмотреть сообщение
pawn Код:
COMMAND:killplayer(playerid, params[])
{
    if(IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You're not an admin!");
    else
    {
        new ID;
        if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_RED, "USAGE: /killplayer <ID>");
        else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_RED, "Player is not connected");
        else
        {
            SendClientMessage(ID, COLOR_RED, "You have been killed by an Admin!");
            SetPlayerHealth(ID, 0);
            SendClientMessage(playerid, COLOR_RED, "Player killed!");
        }
    }
    return 1;
}
Still says "File or Function not found" but when I remove the one you made, if doesnt say "File or function not found" :S Any ideas ?
Reply
#4

Are you sure you have sscanf Plugin in your plugins directory/folder and in server.cfg?
Reply
#5

'Yep
Reply
#6

Quote:
Originally Posted by rubygta
Посмотреть сообщение
'Yep
Show me logs.
Reply
#7

hm are you sure you saved the fs / gm in the right directory?
I have the problem sometimes when I forget to change the directory and then I save it wrong...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)