/m(egaphone) problem
#1

Hello everyone,
I was having problem with the /megaphone command for LSPD, FBI and NG.

It was supposed to work while Inisde any of these vehicles but only works for LSPD. It doesn't work in NG and FBI vehicle.

Here is the code,
Код:
CMD:m(playerid, params[])
{
	new string[128];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsANG(playerid) && !IsAFBI(playerid) && !IsASSA(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an Leo Officer.");
	if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/m)egaphone [text]");
	if(AntiAdv(playerid, params)) return 1;
	if(!IsLeoVehicle(GetPlayerVehicleID(playerid) && !IsNGVehicle (GetPlayerVehicleID(playerid) && !IsFBIVehicle (GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be in an LEO vehicle to use the megaphone.");
    format(string, sizeof(string), "[%s:o< %s]", RPN(playerid), params);
	SendNearbyMessage(playerid, 40, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
	return 1;
}
I need help.
Reply
#2

show me isLeoVehicle, stock/or public w/e the code is for "isLeoVehicle"
Reply
#3

Код:
 else if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1)
	    {
		    new Float:pos[3];
		    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		    SendClientMessage(playerid, COLOR_ORANGE, " This vehicle is restricted to the LSPD faction.");
	    }
Код:
else if(IsFBIVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 6)
	    {
		    new Float:pos[3];
		    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		    SendClientMessage(playerid, COLOR_ORANGE, " This vehicle is restricted to the FBI faction.");
	    }
Reply
#4

wrong codes man i said the code for isaleovehicle that means the stock!
Reply
#5

Sorry man here you go!
Код:
stock IsLeoVehicle(vehicleid)
{
	for(new i=0; i<26; i++)
	{
	    if(vehicleid == FacInfo[1][fCars][i]) return 1;
	}
	return 0;
}

stock IsNGVehicle(vehicleid)
{
	for(new i=0; i<26; i++)
	{
	    if(vehicleid == FacInfo[7][fCars][i]) return 1;
	}
	return 0;
}

stock IsFBIVehicle(vehicleid)
{
	for(new i=0; i<26; i++)
	{
	    if(vehicleid == FacInfo[6][fCars][i]) return 1;
	}
	return 0;
}
Reply
#6

pawn Код:
!IsLeoVehicle(GetPlayerVehicleID(playerid) || !IsNGVehicle (GetPlayerVehicleID(playerid) || !IsFBIVehicle (GetPlayerVehicleID(playerid)
Reply
#7

I now have this error,
Код:
\gamemodes\SRP.pwn(5454) : error 001: expected token: ",", but found "return"
Script line.
Код:
if(!IsLeoVehicle(GetPlayerVehicleID(playerid) || !IsNGVehicle (GetPlayerVehicleID(playerid) || !IsFBIVehicle (GetPlayerVehicleID(playerid) return SendClientMessage(playerid, COLOR_GREY, "You must be in an LEO vehicle to use the megaphone.");
Reply
#8

pawn Код:
if(!IsLeoVehicle(GetPlayerVehicleID(playerid) || !IsNGVehicle (GetPlayerVehicleID(playerid) || !IsFBIVehicle (GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be in an LEO vehicle to use the megaphone.");
Reply
#9

It shows the same error.
Reply
#10

pawn Код:
if(!IsLeoVehicle(GetPlayerVehicleID(playerid) || !IsNGVehicle(GetPlayerVehicleID(playerid) || !IsFBIVehicle(GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be in an LEO vehicle to use the megaphone.");
It is different trust me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)