21.03.2018, 12:46
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.
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.
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(playerid, params[]) {
new vehid, color1, color2;
new admstring[256];
if (PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu esti autorizat sa folosesti aceasta comanda!");
if(sscanf(params, "iii", vehid, color1, color2)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Syntax: /veh <carid> <color 1> <color 2>");
if (vehid < 400 || vehid > 611) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid car id! [Car ID's range from 400 -> 611]");
else
{
new Float:x, Float:y, Float:z, Float:ang;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, ang);
vCar[playerid] = AddStaticVehicle(vehid, x + 3, y, z, ang, color1, color2);
PutPlayerInVehicle(playerid, vCar[playerid], 0);
format(admstring, sizeof(admstring), "AdmCMD: %s has spawned a %s (%d) (%d total cars).", GetName(playerid), VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400], vehid, vCar[playerid]);
}
SMA(COLOR_LIGHTRED, admstring);
return 1;
}
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.