SA-MP Forums Archive
cmd problem - 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: cmd problem (/showthread.php?tid=133859)



cmd problem - 02manchestera - 14.03.2010

i need to add a team into this cmd but cnt get it right any ideas

Код:
if(gTeam[playerid] == TEAM_MERC)
Код:
if (strcmp("/bomb", cmdtext, true) == 0)
	{
	if(gPlayerClass[playerid] == DEMOLITION)
				{
				  if(pSpawned[playerid] == 1)
					{
						if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
			  			{
			  			  if( hasbombs[playerid] == 1)
			  			  {
					  		if(Planted[playerid] == 1)
						    	{
						      GivePlayerWeapon(playerid, 40, 1);
						      ClearAnimations(playerid);
						      ApplyAnimation(playerid,"PED","bomber",4.0,0,0,0,0,1000);
						      SetTimerEx("Explode", 1200, 0, "i", playerid);
						      SetPlayerArmedWeapon(playerid, 0);
						      return 1;
								}
			  			    if(Planted[playerid] == 0)
			  			    {
					  			GetPlayerPos(playerid, bx[playerid], by[playerid], bz[playerid]);
									C4[playerid] = CreateObject(1252, bx[playerid], by[playerid], bz[playerid]-1, -87.6624853592, 0.000000, 0.000000);
									Planted[playerid] = 1;
									ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,1000);
									SendClientMessage(playerid,COLOR_YELLOW,"Bomb Planted, .");
									return 1;
								}
								}
 								}
								}
								}
								return 1;
								}



Re: cmd problem - Deat_Itself - 14.03.2010

Код:
if (strcmp("/bomb", cmdtext, true) == 0)
	{
	if(gPlayerClass[playerid] == DEMOLITION && gTeam[playerid] == TEAM_MERC)
				{
				  if(pSpawned[playerid] == 1)
					{
						if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
			  			{
			  			  if( hasbombs[playerid] == 1)
			  			  {
					  		if(Planted[playerid] == 1)
						    	{
						      GivePlayerWeapon(playerid, 40, 1);
						      ClearAnimations(playerid);
						      ApplyAnimation(playerid,"PED","bomber",4.0,0,0,0,0,1000);
						      SetTimerEx("Explode", 1200, 0, "i", playerid);
						      SetPlayerArmedWeapon(playerid, 0);
						      return 1;
								}
			  			    if(Planted[playerid] == 0)
			  			    {
					  			GetPlayerPos(playerid, bx[playerid], by[playerid], bz[playerid]);
									C4[playerid] = CreateObject(1252, bx[playerid], by[playerid], bz[playerid]-1, -87.6624853592, 0.000000, 0.000000);
									Planted[playerid] = 1;

									ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,1000);
									SendClientMessage(playerid,COLOR_YELLOW,"Bomb Planted, .");
									return 1;
								}
								}
 								}
								}
								}
								return 1;
								}
now this command can be only use be TEAM_MERC


Re: cmd problem - 02manchestera - 14.03.2010

Thanks i did get it working by makeing the cmd twice but i switch it to this