Veh command problem
#1

Hello,
Recently I have started adding factions on my server. Now this is going all fine, Im making steady progress, but one thing is really not making any sense to me.
PHP код:
CMD:veh(playeridparams[]) {
    new 
vehidcolor1color2;
    new 
admstring[256];
    if (
PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playeridCOLOR_LIGHTRED"Nu esti autorizat sa folosesti aceasta comanda!");
    if(
sscanf(params"iii"vehidcolor1color2)) return SendClientMessage(playeridCOLOR_LIGHTRED"Syntax: /veh <carid> <color 1> <color 2>");
    if (
vehid 400 || vehid 611) return SendClientMessage(playeridCOLOR_LIGHTRED"Invalid car id! [Car ID's range from 400 -> 611]");
    else
    {
        new 
Float:xFloat:yFloat:zFloat:ang;
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playeridang);
        
vCar[playerid] = AddStaticVehicle(vehid3yzangcolor1color2);
        
PutPlayerInVehicle(playeridvCar[playerid], 0);
        
format(admstringsizeof(admstring), "AdmCMD: %s has spawned a %s (%d) (%d total cars)."GetName(playerid), VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400], vehidvCar[playerid]);
    }
    
SMA(COLOR_LIGHTREDadmstring);
    return 
1;

That is my veh command, now the problem is when I spawn a vehicle the total cars shows 12, aka the 11 faction vehicles + my vehicle. All my faction vehicles are created in OnGamemodeInit using AddStaticVehicleEx...

Why are they mixing? By the way, when I use AddStaticVehicleEx I use newsv[1] = ... etc, so it shouldnt be mixing with vCar at all.
Reply


Messages In This Thread
Veh command problem - by Byonic - 21.03.2018, 12:46
Re: Veh command problem - by Jithu - 21.03.2018, 14:14
Re: Veh command problem - by Byonic - 21.03.2018, 14:43
Re: Veh command problem - by ISmokezU - 21.03.2018, 15:42
Re: Veh command problem - by Byonic - 21.03.2018, 17:48

Forum Jump:


Users browsing this thread: 1 Guest(s)