17485) : warning 213: tag mismatch
#6

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
pawn Код:
!strcmp(cmd, "/engine", true) == 0
! checks if it returns 0, but you're also doing == 0 to check if it returns 0.
Either just have !strcmp or == 0, not both.

And the second "|| strcmp" check's if it does not return 0, since you don't have ! or == 0.
Therefore your command will trigger if you use /engine or anything other than /e.
So you need to put ! or == 0 with the second as well.

(Note: Strcmp returns 0 if you entered the string, /engine or /e, but it return 1 or -1 if you did not.)

OnPlayerShootPlayer requires the OPSP (OnPlayerShootPlayer) include.
You can send me the repair code for "/engine" in pastebin ?
and i have more bug in /tazer
the command give me gun but the gun isn't give tazer.

the code:
Код HTML:
if(strcmp(cmd, "/tazer", true) ==0 || strcmp(cmd, "/ta", true) ==0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(IsACop(playerid))
			{
			        new Ammo = GetPlayerAmmo(playerid);
					if(Ammo < 0)
					    return 1;
					if(GetPlayerWeapon(playerid)==24)
					{
                        AC_RemovePlayerWeapon(playerid, 24);
                        AC_GivePlayerWeapon(playerid,23,Ammo);
                        format(string, sizeof(string), "* %s unholsters his/her tazer.", sendername);
						ProxDetector(30.0, playerid, string, COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE);
					}
					else if(GetPlayerWeapon(playerid)==23)
					{
					    AC_RemovePlayerWeapon(playerid, 23);
					    AC_GivePlayerWeapon(playerid,24,Ammo);
					    format(string, sizeof(string), "* %s holsters his/her tazer.", sendername);
						ProxDetector(30.0, playerid, string, COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE);
					}
			}
			else return SendClientMessage(playerid, COLOR_GREY, "You are not a Cop!");
		}
		return 1;
	}
Reply


Messages In This Thread
17485) : warning 213: tag mismatch - by AdiRoS - 29.03.2015, 07:20
Re: 17485) : warning 213: tag mismatch - by CalvinC - 29.03.2015, 08:20
Re: 17485) : warning 213: tag mismatch - by iZN - 29.03.2015, 08:23
Re: 17485) : warning 213: tag mismatch - by CalvinC - 29.03.2015, 08:48
Re: 17485) : warning 213: tag mismatch - by iZN - 29.03.2015, 09:37
Re: 17485) : warning 213: tag mismatch - by AdiRoS - 29.03.2015, 09:53
Re: 17485) : warning 213: tag mismatch - by CalvinC - 29.03.2015, 10:43
Re: 17485) : warning 213: tag mismatch - by AdiRoS - 30.03.2015, 09:32

Forum Jump:


Users browsing this thread: 1 Guest(s)