how can i make /kill like not for wanted player help
#1

hey i have been trying to look for a script /kill

here how it need to work when a player with 1,2,3,4,5,6 wanted level they cant use the commands if tthe player have
0 wanted level they can use it please help i use dcmd(kill,5,cmdtext) plz help and onplayercommands
Reply
#2

i dont understand what you mean but here

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/kill", cmdtext, true, 5) == 0)
	{
	SetPlayerHealth(playerid, 0);
	SendClientMessage(playerid, 0x2200FF, "(INFO) You have commited suicide!");
	return 1;
Reply
#3

pawn Код:
dcmd_kill(playerid,params[])
{
    if(GetPlayerWantedLevel(playerid) >= 1) return SendClientMessage(playerid, -1, "You are wanted, you cannot kill yourself!");
    SetPlayerHealth(playerid, 0);
    SendClientMessage(playerid, -1, "You killed yourself!");
    return 1;
}
Here. This prevents people with a wanted level to /kill.

Out of three of these posts, this is the most efficient way to do this. It has less lines and looks better.

EDIT: Below post, not really. Mine looks more easier to understand, in my opinion..
Reply
#4

pawn Код:
command(kill,playerid,params[])
{
    if(GetWantedLevel(playerid) >= 1)
    {
        SendClientMessage(playerid, COLOR_WHITE, "You can't use that, you're wanted!");
        return 1;
    }
    else
    {
        SetPlayerHealth(playerid, 0):
    }
}
Reply
#5

Quote:
Originally Posted by Kindred
Посмотреть сообщение
pawn Код:
dcmd_kill(playerid,params[])
{
    if(GetPlayerWantedLevel(playerid) >= 1) return SendClientMessage(playerid, -1, "You are wanted, you cannot kill yourself!");
    SetPlayerHealth(playerid, 0);
    SendClientMessage(playerid, -1, "You killed yourself!");
    return 1;
}
Here. This prevents people with a wanted level to /kill.

Out of three of these posts, this is the most efficient way to do this. It has less lines and looks better.
Sure it's probably the most 'efficient', but for new-er scripters, mine would most likely be the easiest to read and comprehend.
Reply
#6

Use GetPlayerWantedLevel. Like this:

pawn Код:
if(GetPlayerWantedLevel(playerid) == 0) // if the player's wanted level equals to zero
{
    // kill
    SetPlayerHealth(playerid, -9.999999);
    return 1;
}
else
{
    // if it's something else
    SendClientMessage(playerid, -1, "You're wanted and cannot use this command!");
}
Reply
#7

omg thanks all you guys i learn different kind of way thanks all of yaa 5 start yaa
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)