SA-MP Forums Archive
/explode command? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /explode command? (/showthread.php?tid=174868)



/explode command? - Face9000 - 07.09.2010

Hi all,someone have /explode command?

Example,when i type /explode playerid,the player will explode.

Thanks


Re: /explode command? - playbox12 - 07.09.2010

Dude, this is NOT the script request tread, use the search function..

Post in the script request section, if you want a complete code


Re: /explode command? - iggy1 - 07.09.2010

Heres a quick one iv made with zcmd + sscanf.

pawn Код:
COMMAND:explode(playerid,params[])
{
    new pid;
    if(sscanf(params,"u",pid))return SendClientMessage(playerid,0xff0000FF,"ERROR: Usage /explode [playerid/name]");
    if(pid != INVALID_PLAYER_ID && IsPlayerConnected(pid))
    {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(pid,x,y,z);
        CreateExplosion(x,y,z,0,5.0);
        GameTextForPlayer(pid,"BOOM!",3000,3);
        return 1;
    }
    else SendClientMessage(playerid,0xff0000FF,"ERROR: Player not found");
    return 1;
}



Re: /explode command? - Face9000 - 07.09.2010

lol where i need to paste?


Re: /explode command? - iggy1 - 07.09.2010

Don't bother unless you use zcmd and sscanf (which you should use btw).


Re: /explode command? - Sparnex - 07.09.2010

Код:
if(strcmp(cmd, "/explode", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 4)
		{
			SendClientMessage(playerid, COLOR_GREY, "/explode [Playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		if(IsPlayerConnected(giveplayerid))
		{
			if(PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
			        new targetlevel = PlayerInfo[giveplayerid][pAdmin];
					new playerlevel = PlayerInfo[playerid][pAdmin];
					if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* You can not ban People that is higher Than You!");
      				if(giveplayerid != playerid && Untouchable[giveplayerid]) return SendClientMessage(playerid, COLOR_GREY, "* You Can't Do this on This player!");
					format(string, sizeof(string), "[ADMIN]: %s has exploded %s (%d).",sendername,giveplayer,giveplayerid);
					ABroadCast(COLOR_LIGHTRED,string, 5);
					format(string, sizeof(string), "You have Successfuly Exploded %s's (%d)",giveplayer,giveplayerid);
					SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
					format(string, sizeof(string), "Administrator %s Has Exploded You",sendername);
					SendClientMessage(giveplayerid, TEAM_GROVE_COLOR, string);
					new Float:boomx, Float:boomy, Float:boomz;
					GetPlayerPos(giveplayerid,boomx, boomy, boomz);
					CreateExplosion(boomx, boomy , boomz, 7, 1);
					new y, m, d;
					new h,mi,s;
					getdate(y,m,d);
					gettime(h,mi,s);
					format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Exploded to %s",d,m,y,h,mi,s,sendername,giveplayer);
					ExplodeLog(string);
					if (PlayerInfo[giveplayerid][pAchievement12] == 0)
					{
					    TextDrawSetString(Textdraw64[giveplayerid],"Congratulations! ~n~~n~You have earned the medal ~n~~b~Acme Dinamyte (12) ~n~~n~~w~you won ~g~$125");
	    				ShowAchievement(giveplayerid);
						SafeGivePlayerMoney(giveplayerid,125);
						PlayerInfo[giveplayerid][pAchievement12] = 1;
					}
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}