/kill - 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)
+--- Thread: /kill (
/showthread.php?tid=521831)
/kill -
Gafsi - 24.06.2014
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
Re: /kill -
AMouldyLemon - 24.06.2014
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
Re: /kill -
Beckett - 24.06.2014
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);
}
}