SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/08/2011, 01:31 PM   #1
Chris_Morrison
Huge Clucker
 
Join Date: Aug 2011
Posts: 400
Reputation: 2
Default Bug with cars

Hi
I just download a mod but there is much bugs
1.All players can enter SaNews cars Hitman agency.
2.Some of the LSPD vehicles bugged i enter as a chief of the police and it's write:You dont have keys of this vehicle
and some LSPD vehicles can be stolen all players can get in and take it 0-0
3.Some of the LSPD cars can't use /m(megaphone) and news can't use /news in the cars
What to do?
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(PlayerInfo[playerid][pJailed] == 2)
    {
        new string[256];
        SendClientMessage(playerid, COLOR_LIGHTRED, "~ Do not bug abuse or get banned! ~");
        new Float:cx, Float:cy, Float:cz;
        GetPlayerPos(playerid, cx, cy, cz);
        SetPlayerPos(playerid, cx,  cy, cz);
        new giveplayer[MAX_PLAYER_NAME];
        GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
        format(string, sizeof(string), "AdmCmd: %s has been trying to prisonbreak from admin jail!", giveplayer);
        ABroadCast(COLOR_YELLOW,string,1);
    }
    if (dying[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_GRAD2, "~ You can`t drive when you are dying! ~");
        TogglePlayerControllable(playerid, 0);
        ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
    }
    if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)
    {
    if (IsACopCar(vehicleid) && !ispassenger)
        {
            if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
            else {
                new Float:slx, Float:sly, Float:slz;
                GetPlayerPos(playerid, slx, sly, slz);
                SetPlayerPos(playerid, slx, sly, slz);
                SendClientMessage(playerid, COLOR_GRAD2, "You are not in the LSPD!");
            }
        }
        if(IsAGarageCar(vehicleid) && !ispassenger)
        {
            if(IsAGarageMan(playerid)) {}
            else {
                new Float:cx, Float:cy, Float:cz;
                GetPlayerPos(playerid, cx, cy, cz);
                SetPlayerPos(playerid, cx,  cy, cz);
                SendClientMessage(playerid, COLOR_GRAD2, "You are not Garage worker!");
            }
        }
        if (IsALSPCar(vehicleid) && !ispassenger)
        {
            if(IsAPrisonGuard(playerid) || IsACop(playerid)) {}
           else
            {
                RemovePlayerFromVehicle(playerid);
                new Float:slx, Float:sly, Float:slz;
                GetPlayerPos(playerid, slx, sly, slz);
                SetPlayerPos(playerid, slx, sly, slz);
                SendClientMessage(playerid, COLOR_GRAD2, "You are not in the LSPD!");
            }
        }
        if (IsAnAmbulance(vehicleid) && !ispassenger)
        {
      if(PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4) { }
            else
            {
                new Float:cx, Float:cy, Float:cz;
                GetPlayerPos(playerid, cx, cy, cz);
                SetPlayerPos(playerid, cx,  cy, cz);
            }
        }
        /*if(IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == 1 && CarInfo[vehicleid][cOwned] == 1)
        {
            if(PlayerInfo[playerid][pAdmin] >= 1337 && AdminDuty[playerid] == 1) { }
            else
            {
                new Float:cx, Float:cy, Float:cz;
                GetPlayerPos(playerid, cx, cy, cz);
                SetPlayerPos(playerid, cx, cy, cz);
            }
        }*/

    }
    return 1;
}
Chris_Morrison is offline   Reply With Quote
Old 24/08/2011, 01:53 PM   #2
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 2,076
Reputation: 126
Default Re: Bug with cars

mod? FS?
__________________
Looking for scripter? PM me (NOPE RETIRED)
=WoR=Varth is offline   Reply With Quote
Old 24/08/2011, 02:00 PM   #3
Chris_Morrison
Huge Clucker
 
Join Date: Aug 2011
Posts: 400
Reputation: 2
Default Re: Bug with cars

http://forum.sa-mp.com/showthread.php?t=203708
this one
GF edit
Chris_Morrison is offline   Reply With Quote
Old 24/08/2011, 02:09 PM   #4
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 2,076
Reputation: 126
Default Re: Bug with cars

Ask there.
__________________
Looking for scripter? PM me (NOPE RETIRED)
=WoR=Varth is offline   Reply With Quote
Old 24/08/2011, 02:17 PM   #5
Chris_Morrison
Huge Clucker
 
Join Date: Aug 2011
Posts: 400
Reputation: 2
Default Re: Bug with cars

please help no one will reply there it's old topic
Chris_Morrison is offline   Reply With Quote
Old 24/08/2011, 02:41 PM   #6
qUick1337
Big Clucker
 
Join Date: Dec 2009
Posts: 100
Reputation: 0
Default Re: Bug with cars

1. Go to
Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
add this:
Code:
if(newcar == MYOLDCAR || newcar == MYOLDCAR || newcar == MYOLDCAR)
		{
		    if(PlayerInfo[playerid][pMember] == FACTIONID || PlayerInfo[playerid][pLeader] == FACTIONID){ }
		    else
		    {
		        SendClientMessage(playerid,COLOR_LIGHTRED,"   You don't have keys of this vehicle !");
		        RemovePlayerFromVehicle(playerid);
		    }
		}
How to find oldcar ? Enter in vehicle then type /oldcar

2. Remake
Code:
public IsACopCar
( remake oldcar's from all LSPD vehicles )

3. If you make the point 2 (2. Remake public IsACopCar ( remake oldcar's from all LSPD vehicles ) ) this will be solved.

xD
qUick1337 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
I need help with a script i can carry cars with airplanes and cars [USAK]Icey Help Archive 8 23/08/2011 11:18 PM
Tuned cars --after respawn--> normal cars Edna Krabapel Help Archive 8 31/01/2010 07:52 PM
Give all cars in OnGameModeInit Components (Tune all cars) RyDeR` Help Archive 4 05/10/2009 04:37 PM
LARP: Cars.cfg adding cars problem... Typhome Help Archive 7 06/07/2009 12:46 PM


All times are GMT. The time now is 04:41 AM.


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