31.10.2012, 11:30
i wanna khow how to make a /kill cmd
if (strcmp("/kill", cmdtext, true, 5) == 0)
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
CMD:kill(playerid, params[])
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
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;
}
#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; }
#include <zcmd> |
CMD:kill(playerid, params[]) { SetPlayerHealth(playerid, 0); return 1; }
pawn Код:
|