Stock LoadPlates
#1

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.
Reply
#2

what does IsCopVehicle return ??
Reply
#3

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.
Reply
#4

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;
}
Reply
#5

Not working
Reply
#6

Anyone?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)