command poblem
#1

I have changed this command from pressing keys to /plantbomb but it creates loads of error so { } are not right but i cant work out what ones it is any ideas

Код:
if (strcmp("/plantbomb", 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, Press 'CROUCH + FIRE' to detonate it.");
									return 1;
								}
								}
Reply
#2

Can you Please Show What The Error's Are?
Reply
#3

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\my server\pawno\include\icpmv2.inc(61) : error 004: function "OnPlayerEnterInvisibleCP" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\pawno\include\icpmv2.inc(68) : error 004: function "OnPlayerLeaveInvisibleCP" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\pawno\include\foreach.inc(346) : warning 201: redefinition of constant/macro (symbol "OnPlayerConnect")
C:\Program Files\Rockstar Games\GTA San Andreas\my server\pawno\include\foreach.inc(436) : warning 201: redefinition of constant/macro (symbol "OnPlayerDisconnect")
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(970) : error 017: undefined symbol "GetPlayerSpeedSpeedo"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(980) : error 017: undefined symbol "IsPlayerInPlane"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(982) : error 017: undefined symbol "GetPlayerSpeedSpeedo"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(984) : error 017: undefined symbol "GetPlayerSpeedSpeedo"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(1051) : error 017: undefined symbol "GetPlayerSpeed"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(1052) : error 017: undefined symbol "IsPlayerInPlane"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(1063) : error 004: function "SendClientMessageToAdmins" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(1110) : error 004: function "MutePlayer" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2394) : error 017: undefined symbol "CheckForLevelUpdate"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2488) : error 017: undefined symbol "RestoreClassWeapons"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2506) : error 004: function "SettingPlayerTeam" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2545) : error 017: undefined symbol "RestoreClassWeapons"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2547) : error 017: undefined symbol "Vip"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(3710) : error 017: undefined symbol "CheckForLevelUpdate"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(3729) : error 017: undefined symbol "SendMERCMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4173) : error 017: undefined symbol "SendUSAMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4179) : error 017: undefined symbol "SendUSAMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4185) : error 017: undefined symbol "SendUSAMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4191) : error 017: undefined symbol "SendUSAMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4197) : error 017: undefined symbol "SendUSAMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4203) : error 017: undefined symbol "SendUSAMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4209) : error 017: undefined symbol "SendUSAMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4215) : error 017: undefined symbol "SendUSAMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(4221) : error 017: undefined symbol "SendUSAMessage"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#4

use that its the right code , if it gave "loose indentation" warning at this under ur includes : #pragma tabsize 0

Код:
if (strcmp("/plantbomb", 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, Press 'CROUCH + FIRE' to detonate it.");
									return 1;
								}
								}
 								}
								}
								}
								return 1;
								}
Reply
#5

Most of your errors are variables or functions that you didn't declare or just misspelled the name of the variable or function. So you better check that you declared the variables before you actually use them.
Reply
#6

Quote:
Originally Posted by DesertFoxNight
Most of your errors are variables or functions that you didn't declare or just misspelled the name of the variable or function. So you better check that you declared the variables before you actually use them.
he just missed 4+ brackets
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)