how to make a /kill?
#1

like dis





cmd(die, playerid, params[])
{
new string[120];
if(GetPVarInt(playerid, "Spawned") == 0)
return SendClientMessage(playerid, COLOR_ERROR, "You must be spawned to use this command.");
if(GetPVarInt(playerid, "Jailed") == 1)
return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command while in jail.");
if(GetPVarInt(playerid, "Cuffed") == 1)
return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command while cuffed.");
if(GetPVarInt(playerid, "HasSTDs") == 1)
return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command with STDs.");
SetPlayerHealth(playerid, -1);
format(string, 120, "%s(%d) has commited suicide using /die. Emo D: ", PlayerInfo(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
return 1;
}













i wanna it /kill
Reply
#2

I don't know if you're using these PVars, so a simple /kill command would be
pawn Код:
CMD:kill( playerid, params[ ] )
{
    SetPlayerHealth( playerid, 0.0 );
    return 1;
}
Reply
#3

it should works.

Dwane typed simple usage but you have another conditions just remake it.

pawn Код:
cmd(die, playerid, params[])
{
    if(!GetPVarInt(playerid, "Spawned")) return SendClientMessage(playerid, COLOR_ERROR, "You must be spawned to use this command.");
    if(GetPVarInt(playerid, "Jailed"))  return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command while in jail.");
    if(GetPVarInt(playerid, "Cuffed"))  return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command while cuffed.");
    if(GetPVarInt(playerid, "HasSTDs")) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command with STDs.");

    new string[120];
    SetPlayerHealth(playerid, 0.0);
   
    format(string, sizeof(string), "%s(%d) has commited suicide using /die. Emo D: ", PlayerInfo(playerid));
    SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)