how to make a kill
#1

i wanna khow how to make a /kill cmd
Reply
#2

In STRCMP
pawn Код:
if (strcmp("/kill", cmdtext, true, 5) == 0)
    {
        SetPlayerHealth(playerid, 0.0);
        return 1;
    }
In ZCMD
pawn Код:
CMD:kill(playerid, params[])
{
     SetPlayerHealth(playerid, 0.0);
     return 1;
}
Reply
#3

pawn Код:
if(strcmp(cmdtext, "/kill", true) == 0)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(health > 0.0)
        SetPlayerHealth(playerid);
    else
        return SendClientMessage(playerid, 0xFFFFFFFF, "** You can't do that because you already type that in!");
    return 1;
}
Reply
#4

Quote:

#include <zcmd>

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/kill", true))//the command
    {
        SetPlayerHealth(playerid, 0);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You Killed u self shame u!");//the text if the player died
        return 1;
    }
    return 0;
}
Or with zcmd
Quote:

#include <zcmd>

Код:
CMD:kill(playerid, params[])
{
         SetPlayerHealth(playerid, 0);
         return 1;
}
get zcmd from here http://www.solidfiles.com/d/d20f/ placein /servername/pawno/include

here u are NOTE:U get an error reply i will help!
Reply
#5

Quote:
Originally Posted by 'Pawno.
Посмотреть сообщение
pawn Код:
if(strcmp(cmdtext, "/kill", true) == 0)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(health > 0.0)
        SetPlayerHealth(playerid);
    else
        return SendClientMessage(playerid, 0xFFFFFFFF, "** You can't do that because you already type that in!");
    return 1;
}
You shud use Playerstates..PLAYER_STATE_WASTED to accurately check if hes dead or not
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)