Tazer help
#1

Its working for paramedic and news reporter.. can fix it and allow to factions: 1 2 3 6 7 11 12 13 to use it?

Код:
CMD:tazer(playerid, params[])
{
	if(gTeam[playerid] == 2 || IsACop(playerid) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2) ||(PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pDivision] == 1))
	{
		new string[128];
		if(/*PlayerInfo[playerid][pConnectTime] < 2 ||*/PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");

		if(IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this while you're in a vehicle.");
			return 1;
		}

		if(GetPVarInt(playerid, "IsInArena") >= 0)
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in a arena!");
			return 1;
		}
		if(GetPVarInt( playerid, "EventToken") != 0)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't use the tazer while you're in an event.");
			return 1;
		}
		if(PlayerCuffedTime[playerid] > 0)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
			return 1;
		}
		if(GetPVarInt(playerid, "Injured") == 1)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
			return 1;
		}

		if(PlayerInfo[playerid][pJailed] > 0)
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
			return 1;
		}
		if(PlayerCuffed[playerid] >= 1) {
			SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while tazed/cuffed.");
			return 1;
		}

		if(pTazer[playerid] == 0)
		{
			pTazerReplace[playerid] = PlayerInfo[playerid][pGuns][2];
			if(PlayerInfo[playerid][pGuns][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pGuns][2]);
			format(string, sizeof(string), "* %s unholsters their tazer.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			GivePlayerValidWeapon(playerid, 23, 60000);
			pTazer[playerid] = 1;
		}
		else
		{
			RemovePlayerWeapon(playerid, 23);
			GivePlayerValidWeapon(playerid, pTazerReplace[playerid], 60000);
			format(string, sizeof(string), "* %s holsters their tazer.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			pTazer[playerid] = 0;
		}
		PlayerHasJustTakenTazer[playerid] = 1;
		SetTimerEx("TazerTakenDisable",3*1000,0,"i",playerid);
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GREY, "   You are not member of LEO");
		return 1;
	}
	return 1;
}
Reply
#2

Try it:

Код:
CMD:tazer(playerid, params[])
{
	if((gTeam[playerid] > 0 && gTeam[playerid] < 4) || (gTeam[playerid] == 6 || gTeam[playerid] == 7) || (gTeam[playerid] > 10 && gTeam[playerid] < 14) 
	{
		new string[128];
		if(/*PlayerInfo[playerid][pConnectTime] < 2 ||*/PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");

		if(IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this while you're in a vehicle.");
			return 1;
		}

		if(GetPVarInt(playerid, "IsInArena") >= 0)
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in a arena!");
			return 1;
		}
		if(GetPVarInt( playerid, "EventToken") != 0)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't use the tazer while you're in an event.");
			return 1;
		}
		if(PlayerCuffedTime[playerid] > 0)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
			return 1;
		}
		if(GetPVarInt(playerid, "Injured") == 1)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
			return 1;
		}

		if(PlayerInfo[playerid][pJailed] > 0)
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
			return 1;
		}
		if(PlayerCuffed[playerid] >= 1) {
			SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while tazed/cuffed.");
			return 1;
		}

		if(pTazer[playerid] == 0)
		{
			pTazerReplace[playerid] = PlayerInfo[playerid][pGuns][2];
			if(PlayerInfo[playerid][pGuns][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pGuns][2]);
			format(string, sizeof(string), "* %s unholsters their tazer.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			GivePlayerValidWeapon(playerid, 23, 60000);
			pTazer[playerid] = 1;
		}
		else
		{
			RemovePlayerWeapon(playerid, 23);
			GivePlayerValidWeapon(playerid, pTazerReplace[playerid], 60000);
			format(string, sizeof(string), "* %s holsters their tazer.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			pTazer[playerid] = 0;
		}
		PlayerHasJustTakenTazer[playerid] = 1;
		SetTimerEx("TazerTakenDisable",3*1000,0,"i",playerid);
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GREY, "   You are not member of LEO");
		return 1;
	}
	return 1;
}
Reply
#3

Код:
invalid expression, assumed zero
to line:

Код:
if((gTeam[playerid] > 0 && gTeam[playerid] < 4) || (gTeam[playerid] == 6 || gTeam[playerid] == 7) || (gTeam[playerid] > 10 && gTeam[playerid] < 14) 
	{
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)