SA-MP Forums Archive
Randomly says "vehicle registered to Police Officers" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Randomly says "vehicle registered to Police Officers" (/showthread.php?tid=430836)



Randomly says "vehicle registered to Police Officers" - Spose - 15.04.2013

Hi there. Whenever the car in my script blows up, despawns or W/E, it gets "registered to Police Officers only", and I'm not able to enter it. Any ideas?

Код:
    if (IsACopCar(vehicleid) && !ispassenger)
    {
        if(PlayerInfo[playerid][pMember] != 1)
        {
            new Float:cx, Float:cy, Float:cz;
		    GetPlayerPos(playerid, cx, cy, cz);
		    DOO_SetPlayerPos(playerid, cx,  cy, cz+3);
		    SendClientMessage(playerid,COLOR_GREY," This vehicle is reserved for Police Officers only !");
		}
    }



Re: Randomly says "vehicle registered to Police Officers" - RandomDude - 15.04.2013

You can not enter it ?
When you are a civ or when your a cop?


Re: Randomly says "vehicle registered to Police Officers" - Spose - 15.04.2013

Quote:
Originally Posted by RandomDude
Посмотреть сообщение
You can not enter it ?
When you are a civ or when your a cop?
Oh, sorry, the information wasn't quite accurate.

I'm a civilian, and I'm not able to enter it.


Re: Randomly says "vehicle registered to Police Officers" - Pottus - 15.04.2013

Another Ravens Roleplay help question..... again this is a terrible script with horrible coding don't use it.


Re: Randomly says "vehicle registered to Police Officers" - Ciandlah - 15.04.2013

Okay in the public Line IsACopCar, What is happening is that it is defining a type of car that will be related to the police officer pMember rank. You either need to use vehicle ID numbers that are not in the IsACopCar list or what could be happening is that it continues once a car despawns it arranges all the vehicle in a random order or your randomly respawning it to a location. Check these off first then come back to me


Re: Randomly says "vehicle registered to Police Officers" - Spose - 15.04.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Another Ravens Roleplay help question..... again this is a terrible script with horrible coding don't use it.
Jeez, thanks for helping me, mate. No unnecessary comments.


Re: Randomly says "vehicle registered to Police Officers" - RandomDude - 15.04.2013

Quote:

SendClientMessage(playerid,COLOR_GREY," This vehicle is reserved for Police Officers only !");

That is in your script the car is only for police not any civs


Re: Randomly says "vehicle registered to Police Officers" - Pottus - 15.04.2013

I did help you I advised you to stop wasting your time with a script coded by monkeys riddled with bugs as soon as you get 30 - 40 players online your server will crash.


Re: Randomly says "vehicle registered to Police Officers" - jakejohnsonusa - 15.04.2013

This isn't Raven's Roleplay. Unless he added this whole code.

If you wish anyone to be able to enter the vehicle:

Replace:
Код:
PlayerInfo[playerid][pMember] != 1 //This is checking if they are a member of faction one (PD)
With:
Код:
IsPlayerConnected(playerid) //This will just continue (As long as they are connected to the server, which they 99.9% of the time are
*Or if you aren't new to scripting remove that whole line and make sure the indentation is correct*