SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 24/11/2012, 04:00 AM   #1
razor steven
Big Clucker
 
Join Date: Jun 2012
Posts: 71
Reputation: -4
Default /m(egaphone) problem

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,
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.
__________________
United States Roleplay ~US:RP...

Awesome server with UNIQUE features.
Come and join US:RP today, Bet you're gonna love it.


212.227.143.24:8490

www.us-rp.com
razor steven is offline   Reply With Quote
Old 24/11/2012, 04:30 AM   #2
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: /m(egaphone) problem

show me isLeoVehicle, stock/or public w/e the code is for "isLeoVehicle"
Glad2BeHere is offline   Reply With Quote
Old 24/11/2012, 04:57 AM   #3
razor steven
Big Clucker
 
Join Date: Jun 2012
Posts: 71
Reputation: -4
Default Re: /m(egaphone) problem

Code:
 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.");
	    }
Code:
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.");
	    }
__________________
United States Roleplay ~US:RP...

Awesome server with UNIQUE features.
Come and join US:RP today, Bet you're gonna love it.


212.227.143.24:8490

www.us-rp.com
razor steven is offline   Reply With Quote
Old 24/11/2012, 05:03 AM   #4
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: /m(egaphone) problem

wrong codes man i said the code for isaleovehicle that means the stock!
Glad2BeHere is offline   Reply With Quote
Old 24/11/2012, 05:06 AM   #5
razor steven
Big Clucker
 
Join Date: Jun 2012
Posts: 71
Reputation: -4
Default Re: /m(egaphone) problem

Sorry man here you go!
Code:
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;
}
__________________
United States Roleplay ~US:RP...

Awesome server with UNIQUE features.
Come and join US:RP today, Bet you're gonna love it.


212.227.143.24:8490

www.us-rp.com
razor steven is offline   Reply With Quote
Old 24/11/2012, 05:10 AM   #6
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: /m(egaphone) problem

pawn Code:
!IsLeoVehicle(GetPlayerVehicleID(playerid) || !IsNGVehicle (GetPlayerVehicleID(playerid) || !IsFBIVehicle (GetPlayerVehicleID(playerid)
Glad2BeHere is offline   Reply With Quote
Old 25/11/2012, 01:42 AM   #7
razor steven
Big Clucker
 
Join Date: Jun 2012
Posts: 71
Reputation: -4
Default Re: /m(egaphone) problem

I now have this error,
Code:
\gamemodes\SRP.pwn(5454) : error 001: expected token: ",", but found "return"
Script line.
Code:
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.");
__________________
United States Roleplay ~US:RP...

Awesome server with UNIQUE features.
Come and join US:RP today, Bet you're gonna love it.


212.227.143.24:8490

www.us-rp.com
razor steven is offline   Reply With Quote
Old 25/11/2012, 01:45 AM   #8
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: /m(egaphone) problem

pawn Code:
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.");
Glad2BeHere is offline   Reply With Quote
Old 25/11/2012, 01:49 AM   #9
razor steven
Big Clucker
 
Join Date: Jun 2012
Posts: 71
Reputation: -4
Default Re: /m(egaphone) problem

It shows the same error.
__________________
United States Roleplay ~US:RP...

Awesome server with UNIQUE features.
Come and join US:RP today, Bet you're gonna love it.


212.227.143.24:8490

www.us-rp.com
razor steven is offline   Reply With Quote
Old 25/11/2012, 02:03 AM   #10
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: /m(egaphone) problem

pawn Code:
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
Glad2BeHere is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
100times i ask this and no one know what is problem, help, watch please ;s[LuXadm] problem ProdrifterX Scripting Help 5 25/05/2012 10:27 PM
Problem with Y_ini(Big Problem with this Include+MV Panel) ServerScripter Scripting Help 2 04/09/2011 09:30 PM
Spawn Problem/Virtual World Problem Globe2009 Help Archive 5 05/11/2009 09:12 AM
problem with CWRP in linux (mysql problem) BSMan Server Support 1 16/06/2009 02:36 PM


All times are GMT. The time now is 09:43 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.