SA-MP Forums Archive
Stock LoadPlates - 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: Stock LoadPlates (/showthread.php?tid=410681)



Stock LoadPlates - maiky1499 - 26.01.2013

I'm using a stock, LoadPlates but it's not working very well, I've few types of plates, STOCK:
Код:
stock LoadPlates()
{
	for(new i=0; i<MAX_VEHICLES; i++)
	{
	    SetVehicleNumberPlate(IsCopVehicle(i), "LSPD");
	    SetVehicleNumberPlate(IsMedicVehicle(i), "LSEMS");
	    SetVehicleNumberPlate(IsGuardVehicle(i), "DoC");
	}
	print("Plates sucessfully loaded.");
	return 1;
}
But it's not loading all the plates, around five for each SetVehicleNumberPlate. For MedicVehicle five and same with GuardVehicle and CopVehicle.
When I did only one SetVehicleNumberPlate:
Код:
stock LoadPlates()
{
	for(new i=0; i<MAX_VEHICLES; i++)
	{
	    SetVehicleNumberPlate(IsCopVehicle(i), "LSPD");
	}
	print("Plates sucessfully loaded.");
	return 1;
}
Then all the CopVehicle had LSPD plate.


Re: Stock LoadPlates - SAMPHacker - 26.01.2013

what does IsCopVehicle return ??


Re: Stock LoadPlates - Threshold - 26.01.2013

pawn Код:
stock LoadPlates()
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
            if(IsCopVehicle(i)) return SetVehicleNumberPlate(i, "LSPD");
        else if(IsMedicVehicle(i)) return SetVehicleNumberPlate(i, "LSEMS");
            else if(IsGuardVehicle(i)) return SetVehicleNumberPlate(i, "DoC");
    }
    print("Plates sucessfully loaded.");
    return 1;
}
Give this a shot.


Re : Re: Stock LoadPlates - lelemaster - 26.01.2013

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
pawn Код:
stock LoadPlates()
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
            if(IsCopVehicle(i)) return SetVehicleNumberPlate(i, "LSPD");
        else if(IsMedicVehicle(i)) return SetVehicleNumberPlate(i, "LSEMS");
            else if(IsGuardVehicle(i)) return SetVehicleNumberPlate(i, "DoC");
    }
    print("Plates sucessfully loaded.");
    return 1;
}
Give this a shot.
It wont work because at the first loop, it will stop, you used return.

pawn Код:
stock LoadPlates()
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
            if(IsCopVehicle(i)) SetVehicleNumberPlate(i, "LSPD");
        else if(IsMedicVehicle(i)) SetVehicleNumberPlate(i, "LSEMS");
            else if(IsGuardVehicle(i)) SetVehicleNumberPlate(i, "DoC");
    }
    print("Plates sucessfully loaded.");
    return 1;
}



Re: Stock LoadPlates - maiky1499 - 27.01.2013

Not working


Re: Stock LoadPlates - maiky1499 - 30.01.2013

Anyone?