/kill cmd
#1

Hellos guys today i'm trying to start a gm from 0 but with zcmd, someone can give me a help how can i change this cmd to zcmd:

PHP код:
if (strcmp("/kill"cmdtexttrue10) == 0)
    {
        if (
IsPlayerConnected(playerid))
        {
        
SendClientMessage(playerid0xFF8282AA"You lost $1,000 to pay for your antidepressants.");
        
SendClientMessage(playerid0xFF8282AA"Before you are discharged, Hospital staff will confiscate your weapons.");
        
GivePlayerMoney(playerid, -1000);
        
SetPlayerHealth(playerid,0);
        }
        return 
1;
    } 
I dont know if i have to keep coding with this type of cmd o start to use zcmd.
Reply
#2

PHP код:
CMD:kill(playerid)
{
    
SetPlayerHealth(playerid0);
    return 
1;

Reply
#3

Код:
CMD:kill(playerid)
{
        SendClientMessage(playerid, 0xFF8282AA, "You lost $1,000 to pay for your antidepressants."); 
        SendClientMessage(playerid, 0xFF8282AA, "Before you are discharged, Hospital staff will confiscate your weapons."); 
        GivePlayerMoney(playerid, -1000); 
        SetPlayerHealth(playerid,0); 
        return 1; 
}
Reply
#4

There's a reason I didn't include the messages, because any mention that they'd died there, and were billed, shouldn't be on the command itself, they should be in the callback or the hospital script instead.

It has no check of whether the player is logged in, wanted, or even in a state that should allow the command.
Reply
#5

[/CODE]
Quote:
Originally Posted by Jaua10
Посмотреть сообщение
Hellos guys today i'm trying to start a gm from 0 but with zcmd, someone can give me a help how can i change this cmd to zcmd:

PHP код:
if (strcmp("/kill"cmdtexttrue10) == 0)
    {
        if (
IsPlayerConnected(playerid))
        {
        
SendClientMessage(playerid0xFF8282AA"You lost $1,000 to pay for your antidepressants.");
        
SendClientMessage(playerid0xFF8282AA"Before you are discharged, Hospital staff will confiscate your weapons.");
        
GivePlayerMoney(playerid, -1000);
        
SetPlayerHealth(playerid,0);
        }
        return 
1;
    } 
I dont know if i have to keep coding with this type of cmd o start to use zcmd.

Use : this script and make sure to use the needed includes . . . like "ZCMD ..." and add these colors
PHP код:
CMD:CommandToKill(playerid)//Use any command, as you said /kill
{
 If(
Playerinfo[playerid][pInjured] != 0) return SendClientMessage(playeridCOLOR_GREY"You're not able to kill yourself while injured); // Use it just if he's injured and you can add more things ... like paintball or whatever.
 else
 {
    SetPlayerHealth(playerid, 0);
    SendClientMessage(playerid, COLOR_WHITE, "
You have killed your self . . .");
//Then add the nearby Purple text if you want to.
  }

Quote:

SendClientMessage(playerid, 0xFF8282AA, "You lost $1,000 to pay for your antidepressants.");
SendClientMessage(playerid, 0xFF8282AA, "Before you are discharged, Hospital staff will confiscate your weapons.");

I suggest you adding this things when spawning on the hospital, OnPlayerSpawn ...
Reply
#6

Everything, was already said... Did you sign up just to post that?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)