how to make a /kill? -
DerickClark - 24.11.2012
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
Re: how to make a /kill? -
Konstantinos - 24.11.2012
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;
}
Re: how to make a /kill? -
Channeru - 24.11.2012
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;
}