SA-MP Forums Archive
Faction auto's help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Nederlands/Dutch (https://sampforum.blast.hk/forumdisplay.php?fid=31)
+---- Thread: Faction auto's help (/showthread.php?tid=512055)



Faction auto's help - lulo356 - 08.05.2014

Ik gebruik de Los Santos City Roleplay script v4, maar de faction auto's zijn erg gebugd, kan iemand me misschien vertellen wat de fout is, want ik begrijp het niet meer,

http://pastebin.com/SjAFjcre

pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger)
    {
        if(IsDMVCar(vehicleid))
        {
            if(DrivingTest[playerid] == 0)
            {
                new Float:pos[3];
                GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                SendClientMessage(playerid, COLOR_ORANGE, "You are not taking a drivers license test.");
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "* GPS: Finish the test by driving through all of the checkpoints on your GPS.");
                SetPlayerCheckpoint(playerid,958.4611,-1411.9598,13.1681,5);
                SendClientMessage(playerid, COLOR_RED, "If you exit the car your test will be failed and it will have to be re-done.");
            }
        }
            else if(IsDLCar(vehicleid))
        {
                new Float:pos[3];
                GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        }
        else if(IsFamVehicle(vehicleid) && Fam[vehicleid] != PlayerInfo[playerid][pFam] && !IsACop(playerid))
        {
            new Float:pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to a family.");
        }
        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, " You can't start the engine as it belongs to the LSPD.");
        }
        else if(IsLSFMDVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 5)
        {
            new Float:pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the LSFMD.");
        }
        else if(IsNewsVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 4)
        {
            new Float:pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the News Agency.");
        }
        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, " You can't start the engine as it belongs to the FBI.");
        }
        else if(IsNGVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 7)
        {
            new Float:pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the NG.");
        }
        else if(IsSASTVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 8)
        {
            new Float:pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the SAST.");
        }
        else if(IsTruckerVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_TRUCKER)
        {
            new Float:pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the Truckers.");
        }
        else if(IsGovVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 2)
        {
            new Float:pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the GOV.");
        }
        else if(GetVehicleModel(vehicleid) == 448 || GetVehicleModel(vehicleid) == 461 || GetVehicleModel(vehicleid) == 462 || GetVehicleModel(vehicleid) == 463 || GetVehicleModel(vehicleid) == 468 || GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510 || GetVehicleModel(vehicleid) == 521 || GetVehicleModel(vehicleid) == 522 || GetVehicleModel(vehicleid) == 581 || GetVehicleModel(vehicleid) == 586 && !IsDMVCar(vehicleid))
        {
            new Float:pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SendClientMessage(playerid, COLOR_ORANGE, " You can't drive the motor bike as you dont have an motor license.");
        }
    }
    return 1;
}



Re: Faction auto's help - Infinity - 08.05.2014

Wees allereerst eens wat specifieker, wat bedoel je met "gebugged"?


Re: Faction auto's help - lulo356 - 08.05.2014

Dat iedereen in elke faction car kan, okal zit je niet in de faction


Re: Faction auto's help - mamorunl - 08.05.2014

Heb je toevallig eigen auto's toegevoegd?


Re: Faction auto's help - lulo356 - 08.05.2014

Quote:
Originally Posted by mamorunl
View Post
Heb je toevallig eigen auto's toegevoegd?
Nee heb ik niet


Re: Faction auto's help - ikbenremco - 09.05.2014

Gebruik in plaats van dit:

PHP Code:
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
SetPlayerPos(playeridpos[0], pos[1], pos[2]); 
Code:
ClearAnimations(playerid);
Als ^ niet werkt, zou je je code moeten debugen, met dit bedoel ik de factype van de auto printen en de player zijn pFaction.


Re: Faction auto's help - lulo356 - 11.05.2014

De auto's spawnen wel, maar ze laden niet als faction cars..


Re: Faction auto's help - IndependentGaming - 06.07.2014

Wat je zou kunnen doen is het define van de faction vehicle zoiets als dit


Code:
stock IsACopCar(carid)
{
	for(new v = 0; v < sizeof(LPDVehicles); v++) {
	    if(carid == LPDVehicles[v]) return 1;
	}
	return 0;
}
Code:
		else if(IsACopCar(vehicleid))
		{
		    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
			{
			}
		    else
			{
			    RemovePlayerFromVehicle(playerid);
			    new Float:slx, Float:sly, Float:slz;
				GetPlayerPos(playerid, slx, sly, slz);
				SetPlayerPosEx(playerid, slx, sly, slz);
			    NOPPCheck(playerid);
			    SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the LPD!");
			}
		}
Daarna ga je vervolgends de plek kiezen waar jij je Politie auto wilt hebben

LPDVehicles[0] = AddStaticVehicleEx(596, PosX, PosY, PosZ, Rotation, Kleur[1], Kleur[2], VEHICLE_RESPAWN); // Police Car (LPD)

Zo iets probeer dat maar is.