Explosion CMD won't take health!
#4

@2KY

Fixed, ty!


@Fj0rtiz

Thank you, it worked! But it still isn't what I want! You know, the player doesn't explode, he just gets fire on this head with a sound! What I want is, that the player really should get blown up! Like when a car explodes and you stand near it, you get blown up and fall a few meters away! You know what I mean?? ><
Code again:

PHP код:
COMMAND:explode(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 5)
    {
            new 
Target;
            if(
sscanf(params"u"Target)) SendClientMessage(playeridCOLOR_LIGHTBLUE"USAGE: /explode [playerid]");
            if(!
IsPlayerConnected(Target))
                return 
SendClientMessage(playeridCOLOR_GREY"ERROR:Player is not connected!");
            if(!
sscanf(params"u"Target))
            {
                
//if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
                
if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
                
//if(PlayerAcc[Target][AdminLevel] >= PlayerAcc[playerid][AdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
                
new Float:X;
                new 
Float:Y;
                new 
Float:Z;
                new 
Float:health;
                
GetPlayerPos(Target,X,Y,Z);
                
CreateExplosion(X,Y,Z,1,10);
                
GetPlayerHealth(Target,health);
                
SetPlayerHealth(Targethealth -25);
                new 
tname[MAX_PLAYER_NAME];
                
GetPlayerName(Target,tname,sizeof(tname));
                new 
pname[MAX_PLAYER_NAME];
                
GetPlayerName(Target,pname,sizeof(pname));
                new 
pstring[128];
                new 
tstring[128];
                new 
astring[128];
                
format(pstring,sizeof(pstring),"You have exploded player %s(%d)",tname,Target);
                
format(tstring,sizeof(tstring),"Administrator %s has exploded you!",pname);
                
format(astring,sizeof(astring),"Administrator %s has exploded %s!",pname,tname);
                
SendClientMessage(playerid,COLOR_LIGHTBLUE,pstring);
                
SendClientMessage(playerid,TEAM_GROVE_COLOR,tstring);
                
SendClientMessageToAll(COLOR_GOLD,astring);
            }
            
    }
    else return 
SendClientMessage(playerid,COLOR_RED,"ERROR: You must be level 5 to use this command!");
    return 
1;

Reply


Messages In This Thread
Explosion CMD won't take health! - by Twisted_Insane - 14.02.2012, 19:21
Re: Explosion CMD won't take health! - by Fj0rtizFredde - 14.02.2012, 19:35
Re: Explosion CMD won't take health! - by 2KY - 14.02.2012, 19:48
Re: Explosion CMD won't take health! - by Twisted_Insane - 14.02.2012, 21:17
Re: Explosion CMD won't take health! - by Twisted_Insane - 15.02.2012, 09:54
Re: Explosion CMD won't take health! - by emokidx - 15.02.2012, 10:01
Re: Explosion CMD won't take health! - by Twisted_Insane - 15.02.2012, 10:03
Re: Explosion CMD won't take health! - by emokidx - 15.02.2012, 10:11
Re: Explosion CMD won't take health! - by Universal - 15.02.2012, 10:37
Re: Explosion CMD won't take health! - by Twisted_Insane - 15.02.2012, 11:01

Forum Jump:


Users browsing this thread: 1 Guest(s)