Explosion CMD won't take health!
#1

Hi all!

I made this explode CMD, wanted to ask, with which function should I reduce the player's health for 25?
'Cause the explosion itself won't cause any damage, so how can I set the player's health for 25 lower? I already thought about "SetPlayerHealth", but this wouldn't work, right?

PHP код:
CMD: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;
                
GetPlayerPos(Target,X,Y,Z);
                
CreateExplosion(X,Y,Z,1,10);
                new 
tname[MAX_PLAYER_NAME];
                
GetPlayerName(Target,tname,sizeof(tname));
                new 
pname[MAX_PLAYER_NAME];
                
GetPlayerName(Target,pname,sizeof(pname));
                new 
pstring[256];
                new 
tstring[256];
                new 
astring[256];
                
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)