01.12.2018, 19:29
if i spawn that car in other virtual world , how i create X car in that virtual world
Exemple:
I'm in virtual world 500 and i use /spawncar , the car spawn but in virtual world normal. How i make to spawn in the virtual world where i am?
Exemple:
I'm in virtual world 500 and i use /spawncar , the car spawn but in virtual world normal. How i make to spawn in the virtual world where i am?
PHP код:
new model,color1,color2,sendername[25],string[256];
if(sscanf(params, "iii", model, color1, color2)) return SCM(playerid,0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/spawncar <Model> <Color1> <Color2>");
if(model < 400 || model > 611) return SCM(playerid,COLOR_WHITE,"{FFB870}Invalid car ID! (400-611)");
if(color1 > 255 || color1 < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid car Color! (0-255)");
if(color2 < 0 || color2 > 255) return SendClientMessage(playerid, COLOR_RED, "Invalid car Color! (0-255)");
new Float:X,Float:Y,Float:Z;
GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, X,Y,Z);
new carid = AddStaticVehicle(model, X,Y,Z, 0.0, color1, color2);
Carspawn[carid] = carid;
GetPlayerName(playerid, sendername, sizeof(sendername));
new vehicles = GetVehicleModel(carid) - 400;
format(string, sizeof(string), "AdmCmd: %s has spawned a %s.",sendername,aVehicleNames[vehicles]);
ABroadCast(COLOR_ADMCOMMANDS, string, 4);
format(string,sizeof(string),"VehLog: %s has spawned car model %d.",sendername,model);
Adminlog(string);
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));