Command not working :P
#1

This command wont let me enter a ID, everytime i use it, it just kills me and dont let me enter a player id.. idk whats wrong help me plz

pawn Код:
CMD:akill(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You are not authorized to use this command");
    new targetid, string[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_FADE1, "USAGE:kill [playerid]");
    if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "invalid player id!");
    format(string, sizeof(string), "You have admin killed player %s ", pname);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SetPlayerHealth(targetid,0.0);
    return 1;
}
Reply
#2

Change
pawn Код:
if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_FADE1, "USAGE:kill [playerid]");
to
pawn Код:
if(sscanf(params, "us", targetid)) SendClientMessage(playerid, COLOR_FADE1, "USAGE:kill [playerid]");
Reply
#3

Quote:
Originally Posted by Sulps
Посмотреть сообщение
Change
pawn Код:
if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_FADE1, "USAGE:kill [playerid]");
to
pawn Код:
if(sscanf(params, "us", targetid)) SendClientMessage(playerid, COLOR_FADE1, "USAGE:kill [playerid]");
Still just killing me..
Reply
#4

Код:
 CMD:akill(playerid, params[])
{

   new string[128], playerto, sendername[MAX_PLAYER_NAME] ,giveplayer[MAX_PLAYER_NAME];
   
   if(sscanf(params, "u", playerto)) return SendClientMessage(playerid, COLOR_ORANGE, "{F97804}USAGE:{B4B5B7}{FFFFFF} /akill [playerid/PartOfName]");
   if(!IsPlayerConnected(playerto)) return SendClientMessage(playerid, COLOR_GRAD1,"Invalid player !");
   GetPlayerName(playerto, giveplayer, sizeof(giveplayer));
   GetPlayerName(playerid, sendername, sizeof(sendername));
   format(string, sizeof(string), "You have admin killed player %s ", sendername);
   SendClientMessage(playerid, COLOR_YELLOW, string);
   SetPlayerHealth(playerto, 0);
   return 1;
}
Reply
#5

try this
pawn Код:
command(kill, playerid, params[])
{
     new PID;
    if(PlayerInfo[playerid][pAdmin] < 4) return return SCM(playerid, COLOR_RED, "You are not authorized to use this command");
    if(sscanf(params, "u", PID)) return SendClientMessage(playerid, COLOR, "/kill  [ playerid / Name ]");
    return SetPlayerHealth(PID, 0);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)