dcmd_car(playerid, params[]){ new Index; new tmp[256]; tmp = strtok(params,Index); new tmp2[256]; tmp2 = strtok(params,Index); new tmp3[256]; tmp3 = strtok(params,Index); if(!strlen(tmp)) return SendClientMessage(playerid, red, \"{FFFFFF}[TDc] {375FFF}Használat: {FFFFFF}/car [modelid/jármûnév] [szín1] [szín2]\"); new car; new string[128]; new colour1, colour2; if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp); if(car < 400 || car > 611) return SendClientMessage(playerid, red, \"Hiba: Nincs ilyen jármû!\"); if(car == 406 || car == 425 || car == 432 || car == 444 || car == 520 || car == 553 || car == 577 || car == 592) return SendClientMessage(playerid, red, \"TILTOTT JÁRMÛ!\"); if(car == 407 || car == 408) return SendClientMessage(playerid, red, \"TILTOTT JÁRMÛ!\"); if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2); if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3); if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:X,Float:Y,Float:Z; new Float:Angle,int1; new LVehicleID = GetPlayerVehicleID(playerid); GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid); SpawnedVehicles[playerid] = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); new vehicleid = GetPlayerVehicleID(playerid); new world = GetVehicleVirtualWorld(vehicleid); SetPlayerVirtualWorld(playerid, world); LinkVehicleToInterior(LVehicleID,int1); PlayerPlaySound(playerid,1085,0,0,0); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); format(string, sizeof(string), \"{FFFFFF}[TDc] {375FFF}Jármû lerakva! Név: %s | (Model ID: %d) | Szín1: %d, Szín2: %d\", VehicleNames[car-400], car, colour1, colour2); return SendClientMessage(playerid,lightblue,string);}
new world = GetVehicleVirtualWorld(vehicleid);SetPlayerVirtualWorld(playerid, world);
SetVehicleVirtualWorld(vehicleid,GetVehicleVirtualWorld(playerid));
new world = GetVehicleVirtualWorld(vehicleid);SetPlayerVirtualWorld(playerid, world); helyett: SetVehicleVirtualWorld(vehicleid,GetVehicleVirtualWorld(playerid));
dcmd_car(playerid, params[]){ new Index;new tmp[256]; tmp = strtok(params,Index); new tmp2[256]; tmp2 = strtok(params,Index); new tmp3[256]; tmp3 = strtok(params,Index);if(!strlen(tmp)) return SendClientMessage(playerid, red, \"{FFFFFF}[TDc] {375FFF}Használat: {FFFFFF}/car [modelid/jármûnév] [szín1] [szín2]\"); new car; new string[128]; new colour1, colour2; if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp); if(car < 400 || car > 611) return SendClientMessage(playerid, red, \"Hiba: Nincs ilyen jármû!\"); if(car == 406 || car == 425 || car == 432 || car == 444 || car == 520 || car == 553 || car == 577 || car == 592) return SendClientMessage(playerid, red, \"TILTOTT JÁRMÛ!\"); if(car == 407 || car == 408) return SendClientMessage(playerid, red, \"TILTOTT JÁRMÛ!\"); if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2); if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:X,Float:Y,Float:Z; new Float:Angle,int1; new LVehicleID = GetPlayerVehicleID(playerid); GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid); SpawnedVehicles[playerid] = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);new vehicleid = GetPlayerVehicleID(playerid); new world = GetPlayerVirtualWorld(playerid);SetVehicleVirtualWorld(vehicleid, world); LinkVehicleToInterior(LVehicleID,int1); PlayerPlaySound(playerid,1085,0,0,0); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); format(string, sizeof(string), \"{FFFFFF}[TDc] {375FFF}Jármû lerakva! Név: %s | (Model ID: %d) | Szín1: %d, Szín2: %d\", VehicleNames[car-400], car, colour1, colour2); return SendClientMessage(playerid,lightblue,string);}
SpawnedVehicles[playerid] = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
Elképzelés: Az lenne a cél, hogy ha 9es világba hívom le a kocsit, akkor oda rakja le nekem, ne rakjon vissza a 0-ás világba.[/quote] SetVehicleVirtualWorld(SpawnedVehicles[playerid] ,GetVehicleVirtualWorld(playerid)); akkor ezt szeretnéd?
SetVehicleVirtualWorld(SpawnedVehicles[playerid] ,GetVehicleVirtualWorld(playerid));
SetVehicleVirtualWorld(SpawnedVehicles[playerid] ,GetPlayerVirtualWorld(playerid));
dcmd_car(playerid, params[]){new Index;new tmp[256]; tmp = strtok(params,Index);new tmp2[256]; tmp2 = strtok(params,Index);new tmp3[256]; tmp3 = strtok(params,Index);if(!strlen(tmp)) returnSendClientMessage(playerid, -1, \"{FFFFFF}[TDc] {375FFF}Használat: {FFFFFF}/car [modelid/jármûnév] [szín1] [szín2]\");new car;new string[128];new colour1, colour2;if(!IsNumeric(tmp))car = GetVehicleModelIDFromName(tmp);else car = strval(tmp);if(car < 400 || car > 611) return SendClientMessage(playerid, -1, \"Hiba: Nincs ilyen jármû!\");if(car == 406 || car == 425 || car == 432 || car == 444 || car == 520 || car == 553 || car == 577 || car == 592) return SendClientMessage(playerid, -1, \"TILTOTT JÁRMÛ!\");if(car == 407 || car == 408) return SendClientMessage(playerid, -1, \"TILTOTT JÁRMÛ!\");if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);new Float:X,Float:Y,Float:Z;new Float:Angle,int1;new LVehicleID = GetPlayerVehicleID(playerid);GetPlayerPos(playerid, X,Y,Z);GetPlayerFacingAngle(playerid,Angle);int1 = GetPlayerInterior(playerid);SpawnedVehicles[playerid] = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);new world = GetPlayerVirtualWorld(playerid);SetVehicleVirtualWorld(SpawnedVehicles[playerid], world);LinkVehicleToInterior(LVehicleID,int1);PlayerPlaySound(playerid,1085,0,0,0);PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);format(string, sizeof(string), \"{FFFFFF}[TDc] {375FFF}Jármû lerakva! Név: %s | (Model ID: %d) | Szín1: %d, Szín2: %d\", VehicleNames[car-400], car, colour1, colour2);return SendClientMessage(playerid,-1,string);}