Interior Help - Gang Server
#7

Put this command inside of the callback (OnPlayerCommandText):

PHP код:
if (strcmp("/kill"cmdtexttrue5) == 0)
    {
        
SetPlayerHealth(playerid0);//Setting the player's health to 0 which will kill him.
        
SendClientMessage(playerid, -1"You have committed suicide!");//Sending him a message.
        
return 1;
    } 
And for the /cmds command do you want it with a dialog or normal text?

Now your callback should look like this:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/tpme"cmdtexttrue5) == 0)
    {
     
SetPlayerInterior(playerid15);
        
SetPlayerPos(playerid2220.26, -1148.011025.80);
        
SendClientMessage(playerid, -1"Teleported!");
        return 
1;
    }
    if(
strcmp("/getmeout"cmdtexttrue9) == 0)
    {
        
SetPlayerInterior(playerid0);
        
SetPlayerHealth(playerid0);
        
SendClientMessage(playerid,-1"Done...");
    }
    if (
strcmp("/kill"cmdtexttrue5) == 0)
    {
        
SetPlayerHealth(playerid0);//Setting the player's health to 0 which will kill him.
        
SendClientMessage(playerid, -1"You have committed suicide!");//Sending him a message.
        
return 1;
    }
    return 
0;

Reply


Messages In This Thread
Interior Help - Gang Server - by nicholas1 - 28.10.2012, 17:06
Re: Interior Help - Gang Server - by gtakillerIV - 28.10.2012, 17:12
Re: Interior Help - Gang Server - by nicholas1 - 28.10.2012, 17:14
Re: Interior Help - Gang Server - by gtakillerIV - 28.10.2012, 17:16
Re: Interior Help - Gang Server - by nicholas1 - 28.10.2012, 17:19
Re: Interior Help - Gang Server - by MarTaTa - 28.10.2012, 17:20
Re: Interior Help - Gang Server - by gtakillerIV - 28.10.2012, 17:22
Re: Interior Help - Gang Server - by nicholas1 - 28.10.2012, 17:33
Re: Interior Help - Gang Server - by nicholas1 - 28.10.2012, 17:35
Re: Interior Help - Gang Server - by gtakillerIV - 28.10.2012, 17:36

Forum Jump:


Users browsing this thread: 2 Guest(s)