14.02.2012, 21:17
@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:
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(playerid, COLOR_LIGHTBLUE, "USAGE: /explode [playerid]");
if(!IsPlayerConnected(Target))
return SendClientMessage(playerid, COLOR_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(Target, health -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;
}