(HELP) Police Cars nitro - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: (HELP) Police Cars nitro (
/showthread.php?tid=270420)
(HELP) Police Cars nitro -
spaty2 - 20.07.2011
Hey, i have cop cars and i need that it will have intro
i did do it like this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)
{
AddVehicleComponent(vehicleid, 1010); // Nitro
SendClientMessage(playerid, 0xFFFFFFAA, "Nitro added");
}
{
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 {
//WantedPoints[playerid]+=2;
//SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
But now, i have that inro in all cars
Re: (HELP) Police Cars nitro -
TouR - 20.07.2011
Try this...
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4 && IsACopCar(vehicleid) && !ispassenger)
{
AddVehicleComponent(vehicleid, 1010); // Nitro
SendClientMessage(playerid, 0xFFFFFFAA, "Nitro added");
}
Re: (HELP) Police Cars nitro -
spaty2 - 20.07.2011
Still in all cars
Re: (HELP) Police Cars nitro -
TouR - 20.07.2011
Then your IsACopCar is your problem, Check this out
Re: (HELP) Police Cars nitro -
spaty2 - 20.07.2011
look on this
pawn Код:
public IsACopCar(carid)
{
if((carid >= 16) && (carid <= 38))
{
return 1;
}
return 0;
}
Re: (HELP) Police Cars nitro -
TouR - 20.07.2011
Are the carid's correct? Carid is the order the car created... Maybe you added or removed some cars so the cairds fucked up?
Re: (HELP) Police Cars nitro -
spaty2 - 20.07.2011
No... i fucked with this and there are correct carids
Re: (HELP) Police Cars nitro -
spaty2 - 20.07.2011
on
?
Re: (HELP) Police Cars nitro -
TouR - 20.07.2011
Its the same.. vehicleid or carid take a value so its a number. This is not the problem
Re: (HELP) Police Cars nitro -
spaty2 - 20.07.2011
Like this?
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)
{
if (IsACopCar(vehicleid) && !ispassenger)
{
AddVehicleComponent(vehicleid, 1010); // Nitro
SendClientMessage(playerid, 0xFFFFFFAA, "Nitro added to the Taxi.");
}
{
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 {
//WantedPoints[playerid]+=2;
//SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}