SA-MP Forums Archive
Admin command 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: Admin command problem (/showthread.php?tid=207493)



[Solved]Admin command Problem - rubygta - 06.01.2011

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.


Re: Admin command problem - HyperZ - 06.01.2011

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;
}



Re: Admin command problem - rubygta - 06.01.2011

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 ?


Re: Admin command problem - HyperZ - 06.01.2011

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


Re: Admin command problem - rubygta - 06.01.2011

'Yep


Re: Admin command problem - HyperZ - 06.01.2011

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


Re: Admin command problem - Sascha - 06.01.2011

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...