Removal of 'You need to be in' for a specific faction
#1

Hey, I am using the NGG script and I am wondering, how could I remove the 'You need to be in *faction* to drive this vehicle.' -notification for group type 'Contract Agency', the code for contract agency is the following:

Код:
[g_iGroupType] == 2
The code under is the one which gives the notification if you are not part of the correct faction.


Код:
			{
				RemovePlayerFromVehicle(playerid);
				SetPlayerPos(playerid, slx, sly, slz+1.3);
				defer NOPCheck(playerid);
				format(string, sizeof(string), "You need to be in %s to drive this vehicle.", arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName]);
				SendClientMessageEx(playerid, COLOR_GRAD2, string);
			}
Reply
#2

Bump.
Reply
#3

What is the if statement above the code?
Reply
#4

{
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, slx, sly, slz+1.3);
defer NOPCheck(playerid);
// format(string, sizeof(string), "You need to be in %s to drive this vehicle.", arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName]);
// SendClientMessageEx(playerid, COLOR_GRAD2, string);
}


Like this?

or just:

{
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, slx, sly, slz+1.3);
defer NOPCheck(playerid);

}
Reply
#5

Quote:
Originally Posted by carlo rizzi
Посмотреть сообщение
What is the if statement above the code?
Код:
		else if(DynVeh[vehicleid] != -1)
		{
			new string[128], Float:slx, Float:sly, Float:slz;
			GetPlayerPos(playerid, slx, sly, slz);
			if(DynVehicleInfo[DynVeh[vehicleid]][gv_igID] != INVALID_GROUP_ID && (PlayerInfo[playerid][pMember] != DynVehicleInfo[DynVeh[vehicleid]][gv_igID]))
			{
				RemovePlayerFromVehicle(playerid);
				SetPlayerPos(playerid, slx, sly, slz+1.3);
				defer NOPCheck(playerid);
				format(string, sizeof(string), "You need to be in %s to drive this vehicle.", arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName]);
				SendClientMessageEx(playerid, COLOR_GRAD2, string);
			}
Reply
#6

Quote:
Originally Posted by VanillaRain
Посмотреть сообщение
{
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, slx, sly, slz+1.3);
defer NOPCheck(playerid);
// format(string, sizeof(string), "You need to be in %s to drive this vehicle.", arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName]);
// SendClientMessageEx(playerid, COLOR_GRAD2, string);
}


Like this?

or just:

{
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, slx, sly, slz+1.3);
defer NOPCheck(playerid);

}
I want it the 'You need to be in blahblahblah to drive this vehicle' -message removed from Group Type 2 (Contract Agency) vehicles

This is the grouptype code:
Код:
[g_iGroupType] == 2
Reply
#7

Код:
		else if(DynVeh[vehicleid] != -1)
		{
			new Float:slx, Float:sly, Float:slz;
			GetPlayerPos(playerid, slx, sly, slz);
			if(DynVehicleInfo[DynVeh[vehicleid]][gv_igID] != INVALID_GROUP_ID && (PlayerInfo[playerid][pMember] != DynVehicleInfo[DynVeh[vehicleid]][gv_igID]))
			{
				RemovePlayerFromVehicle(playerid);
				SetPlayerPos(playerid, slx, sly, slz+1.3);
				defer NOPCheck(playerid);
			}
//Edit: I didn't see your last reply, this code won't do it.
Reply
#8

{
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, slx, sly, slz+1.3);
defer NOPCheck(playerid);
format(string, sizeof(string), " ", arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName]);
SendClientMessageEx(playerid, COLOR_GRAD2, string);
}
Reply
#9

Код:
		else if(DynVeh[vehicleid] != -1)
		{
                    new string[128], Float:slx, Float:sly, Float:slz;
                    GetPlayerPos(playerid, slx, sly, slz);
                    if(DynVehicleInfo[DynVeh[vehicleid]][gv_igID] != INVALID_GROUP_ID && (PlayerInfo[playerid][pMember] != DynVehicleInfo[DynVeh[vehicleid]][gv_igID]))
                    {
	                RemovePlayerFromVehicle(playerid);
	                SetPlayerPos(playerid, slx, sly, slz+1.3);
	                defer NOPCheck(playerid);
                        if(arrGroupData[g_iGroupType] != 2)
                        {
	                    format(string, sizeof(string), "You need to be in %s to drive this vehicle.", arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName]); 
                            SendClientMessageEx(playerid,COLOR_GRAD2, string); 
                        }
                    }
Here you go, I checked upon your variables. If it doesn't work, blame yourself.
Reply
#10

Quote:
Originally Posted by youssefehab500
Посмотреть сообщение
Код:
		else if(DynVeh[vehicleid] != -1)
		{
                    new string[128], Float:slx, Float:sly, Float:slz;
                    GetPlayerPos(playerid, slx, sly, slz);
                    if(DynVehicleInfo[DynVeh[vehicleid]][gv_igID] != INVALID_GROUP_ID && (PlayerInfo[playerid][pMember] != DynVehicleInfo[DynVeh[vehicleid]][gv_igID]))
                    {
	                RemovePlayerFromVehicle(playerid);
	                SetPlayerPos(playerid, slx, sly, slz+1.3);
	                defer NOPCheck(playerid);
                        if(arrGroupData[g_iGroupType] != 2)
                        {
	                    format(string, sizeof(string), "You need to be in %s to drive this vehicle.", arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName]); 
                            SendClientMessageEx(playerid,COLOR_GRAD2, string); 
                        }
                    }
Here you go, I checked upon your variables. If it doesn't work, blame yourself.
From what I've understood, this piece of code doesn't remove the message for group type 2 when entering the vehicle, besides, this is what I got:

Код:
./includes/callbacks.pwn(5931) : warning 217: loose indentation
./includes/callbacks.pwn(5931) : error 033: array must be indexed (variable "arrGroupData")
./includes/callbacks.pwn(5934) : warning 217: loose indentation
./includes/callbacks.pwn(5937) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)