#1

hello how to make just one command for players and admins like if i do /kill i will die but if im admin and i do /kill id i will kill player
Reply
#2

pawn Код:
CMD:akill(playerid, params[])
{
    if(// check if player is Admin >=?)
    {
        new targetid;
        if(!strlen(params)) return SendClientMessage(playerid, COLOR_DARKGREY, "Usage: /akill [playerid]");
        if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "This player is not connected!");
        SetPlayerHealth(targetid, -1);
    }
    else
    SendClientMessage(playerid, COLOR_DARKGREY, "You are not allowed to use this command.");
    return 1;
}
An exmaple I have
Reply
#3

There.

pawn Код:
CMD:kill(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"/kill [playerid/partofname]");
        SetPlayerHealth(target,0);
    }
    else
    {
        SetPlayerHealth(playerid,0);
    }
}
Reply


Forum Jump:


Users browsing this thread: