SA-MP Forums Archive
/kill cmd - 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 cmd (/showthread.php?tid=654457)



/kill cmd - Jaua10 - 29.05.2018

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.


Re: /kill cmd - Sew_Sumi - 29.05.2018

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




Re: /kill cmd - UFF - 29.05.2018

Код:
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; 
}



Re: /kill cmd - Sew_Sumi - 29.05.2018

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.


Re: /kill cmd - DALii - 29.05.2018

[/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 ...


Re: /kill cmd - Sew_Sumi - 29.05.2018

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