Sziasztok!Hogy lehet megoldani , hogy amikor lehívom a kocsit lementse , és utána mindig lementse az adott jármûvet , amit használtak?!http://sampforum.hu/index.php?topic=48554.0Ebbõl szeretnék kiindulni mert ebbe csak bele kéne írni de fogalmam sincs hogy hogyan lehetne.
#include <a_samp>new utak0;new utak1;new utak2;new utak3;new utak4;new utak5;new utak6;new utak7;new utak8;new utak9;new utak10;new utak11;new utak12;new utak13;public OnGameModeInit(){ utak0 = GangZoneCreate(1990.689331,543.970153,2179.733886,622.292358); utak1 =GangZoneCreate(1990.689331,622.292358,2179.733886,543.970153); utak2 =GangZoneCreate(2428.138183,628.830322,3383.638671,643.089782); utak3 =GangZoneCreate(3383.427734,561.615783,3396.587890,681.765563); utak4 =GangZoneCreate(3396.965332,642.491577,3588.149658,628.032958); utak5 =GangZoneCreate(3587.462158,625.189392,3683.527343,722.644897); utak6 =GangZoneCreate(3372.494628,688.560363,3355.885986,762.772094); utak7 =GangZoneCreate(3396.522705,666.003784,3551.104492,680.699890); utak8 =GangZoneCreate(3551.096191,680.686096,3535.286376,604.612792); utak9 =GangZoneCreate(2678.671142,735.070922,2694.049072,543.828796); utak10 =GangZoneCreate(3028.085449,540.962768,2692.623046,575.288146); utak11 =GangZoneCreate(3027.832763,540.976379,3052.064941,574.771240); utak12 =GangZoneCreate(3052.406250,563.362304,3133.264404,542.343261); utak13 =GangZoneCreate(3132.375488,560.412902,3151.361328,292.552551); return 1;}public OnPlayerSpawn(playerid){ GangZoneShowForPlayer(playerid, utak0, 0x000000AA); GangZoneShowForPlayer(playerid, utak1, 0x000000AA); GangZoneShowForPlayer(playerid, utak2, 0x000000AA); GangZoneShowForPlayer(playerid, utak3, 0x000000AA); GangZoneShowForPlayer(playerid, utak4, 0x000000AA); GangZoneShowForPlayer(playerid, utak5, 0x000000AA); GangZoneShowForPlayer(playerid, utak6, 0x000000AA); GangZoneShowForPlayer(playerid, utak7, 0x000000AA); GangZoneShowForPlayer(playerid, utak8, 0x000000AA); GangZoneShowForPlayer(playerid, utak9, 0x000000AA); GangZoneShowForPlayer(playerid, utak10, 0x000000AA); GangZoneShowForPlayer(playerid, utak11, 0x000000AA); GangZoneShowForPlayer(playerid, utak12, 0x000000AA); GangZoneShowForPlayer(playerid, utak13, 0x000000AA); return 1;} /*másolatutak1 =GangZoneCreate(1990.689331,622.292358,2179.733886,543.970153); utak2 =GangZoneCreate(2428.138183,628.830322,3383.638671,643.089782); utak3 =GangZoneCreate(3383.427734,561.615783,3396.587890,681.765563); utak4 =GangZoneCreate(3396.965332,642.491577,3588.149658,628.032958); utak5 =GangZoneCreate(3587.462158,625.189392,3683.527343,722.644897); utak6 =GangZoneCreate(3372.494628,688.560363,3355.885986,762.772094); utak7 =GangZoneCreate(3396.522705,666.003784,3551.104492,680.699890); utak8 =GangZoneCreate(3551.096191,680.686096,3535.286376,604.612792); utak9 =GangZoneCreate(2678.671142,735.070922,2694.049072,543.828796);//GangZoneCreate(2694.328369,543.827697,3028.300781,555.305541);//GangZoneCreate(3028.071289,556.749267,2692.308349,575.404968);//GangZoneCreate(2693.209960,543.830444,3028.108398,556.552856); utak10 =GangZoneCreate(3028.085449,540.962768,2692.623046,575.288146); utak11 =GangZoneCreate(3027.832763,540.976379,3052.064941,574.771240); utak12 =GangZoneCreate(3052.406250,563.362304,3133.264404,542.343261); utak13 =GangZoneCreate(3132.375488,560.412902,3151.361328,292.552551);//GangZoneCreate(3071.019287,545.030273,3041.078125,-386.852142); utak14 =GangZoneCreate(3041.078125,-386.852142,3263.463867,-376.228759); utak15 =GangZoneCreate(3041.608154,-386.586364,3065.602783,543.659240); utak16 =GangZoneCreate(3065.133056,274.225158,3300.609375,288.810668); utak17 =GangZoneCreate(3217.797119,372.608917,3202.119873,177.240921); utak18 =GangZoneCreate(3317.959716,477.941070,3301.461425,97.416519); utak19 =GangZoneCreate(3278.157470,98.189537,3322.146484,82.259864); utak20 =GangZoneCreate(3044.866455,-227.100601,2827.940673,-213.108489); utak21 =GangZoneCreate(3136.755859,-385.980499,3122.538085,-515.839904); utak22 =GangZoneCreate(3122.538085,-515.839904,3152.429931,-561.514709); utak23 =GangZoneCreate(3175.192138,-600.202331,3150.631103,-517.955810); utak24 =GangZoneCreate(3152.740966,-602.713867,3159.426269,-594.204833); utak25 =GangZoneCreate(3151.088378,-601.817504,3179.096435,-1177.609008);*/
//-----------------------IntrozeN---------------------//-----------------------Gangzone---------------------//-----------------------Creator----------------------//-----------------------v1.0-------------------------#include <a_samp>#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1#define COLOR_GREENLIGHT 0x9ACD32AA#define COLOR_DARKRED 0xC10B07FFforward Createzone(playerid,color);new Makingzone[MAX_PLAYERS];new Float:ZMinX;new Float:ZMaxX;new Float:ZMinY;new Float:ZMaxY;new GangZone;new Create;public OnFilterScriptInit(){print(\"\\n----------------------------------\");print(\"Gangzone Creator v1.0 by IntrozeN\");print(\"----------------------------------\\n\");if(!fexist(\"/savedzones.txt\")) fopen(\"/savedzones.txt\", io_readwrite);return 1;}public OnFilterScriptExit(){GangZoneHideForAll(GangZone);return 1;}public OnPlayerCommandText(playerid, cmdtext[]){dcmd(zone,4,cmdtext);return 0;}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){if(dialogid == 0){ if(response) { if(listitem == 0) { if(Makingzone[playerid] == 1) return SendClientMessage(playerid,COLOR_DARKRED,\".: Info: You\'re already making a zone. Cancel or Save the current one first :.\"); ShowPlayerDialog(playerid,1,2,\"Color\",\"Blue\\nRed\\nGreen\\nPurple\\nYellow\\nGrey\\nLightblue\\nWhite\\nBlack\",\"Select\",\"Cancel\"); Makingzone[playerid] = 1; } if(listitem == 1) { if(Makingzone[playerid] == 0) return SendClientMessage(playerid,COLOR_DARKRED,\".: Info: You\'re not making a zone. Create one first :.\"); new string[128]; KillTimer(Create); format(string,sizeof(string),\"GangZoneCreate(%f,%f,%f,%f);\\r\\n\",ZMinX,ZMinY,ZMaxX,ZMaxY); new File:save = fopen(\"/savedzones.txt\", io_append); fwrite(save, string); fclose(save); SendClientMessage(playerid,COLOR_GREENLIGHT,\".: Info: Zone created and saved in savedzones.txt :.\"); Makingzone[playerid] = 0; } if(listitem == 2) { if(Makingzone[playerid] == 0) return SendClientMessage(playerid,COLOR_DARKRED,\".: Info: You\'re not making a zone. Create one first :.\"); KillTimer(Create); GangZoneDestroy(GangZone); SendClientMessage(playerid,COLOR_GREENLIGHT,\".: Info: Zone creation cancelled :.\"); Makingzone[playerid] = 0; }}}if(dialogid == 1){ if(response) { if(listitem == 0) { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0x0000FFAA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } if(listitem == 1) { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0xFF0000AA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } if(listitem == 2) { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0x00FF00AA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } if(listitem == 3) { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0xFF00FFAA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } if(listitem == 4) { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0xFFFF00AA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } if(listitem == 5) { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0x888888AA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } if(listitem == 6) { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0x00FFFFAA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } if(listitem == 7) { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0xFFFFFFAA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } if(listitem == { new Float:Z; new color; GetPlayerPos(playerid,ZMinX,ZMinY,Z); color = 0x000000AA; GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY); GangZoneShowForPlayer(playerid,GangZone,color); Create = SetTimerEx(\"Createzone\",100,1,\"ud\",playerid,color); } SendClientMessage(playerid,COLOR_GREENLIGHT,\".: Info: Zone is being created :.\"); SendClientMessage(playerid,COLOR_GREENLIGHT,\".: Info: Check on the minimap while moving to create your zone perfectly then save the zone by typing /zone :.\");}else if(!response){ Makingzone[playerid] = 0;}}return 1;}public Createzone(playerid,color){GangZoneHideForPlayer(playerid,GangZone);GangZoneDestroy(GangZone);new Float:Z;GetPlayerPos(playerid,ZMaxX,ZMaxY,Z);GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);GangZoneShowForPlayer(playerid,GangZone,color);return 1;}dcmd_zone(playerid,params[]){#pragma unused paramsShowPlayerDialog(playerid,0,2,\"Gangzone Creator v1.0 by IntrozeN\",\"Createzone\\nSavezone\\nCancelzone\",\"Select\",\"Cancel\");return 1;}
{pickup3=CreatePickup(1318, 1, 2017.3345,1915.8837,12.3319);}public OnPlayerPickUpPickup(playerid, pickupid){ if(pickupid == pickup3) { SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083); SetPlayerInterior(playerid, 12); }}
Üdv az lenne a problémám hogy csináltam egy pickupos teleportot és addig jó is amíg be kell menni csak kifelé nem tudom hogy csináljameddig kész van: {pickup3=CreatePickup(1318, 1, 2017.3345,1915.8837,12.3319);}public OnPlayerPickUpPickup(playerid, pickupid){ if(pickupid == pickup3) { SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083); SetPlayerInterior(playerid, 12); }}
Igen!
SetPlayerInterior(playerid, 0), SetPlayerPos(playerid, X, Y, Z);
#include <a_samp>new pickup3;public OnFilterScriptInit(){pickup3=CreatePickup(1318, 1, 2017.3345,1915.8837,12.3319);}public OnPlayerPickUpPickup(playerid, pickupid){ if(pickupid == pickup3) { SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083); //ide hogy hova teleportáljon SetPlayerInterior(playerid, 12); //ide az interior id-t SetPlayerInterior(playerid, 0), SetPlayerPos(playerid, 2324.9036,-1148.3251,1050.7101); } }
Ez az interiorban a kijárat teleportja:2324.9036,-1148.3251,1050.7101
#include <a_samp>new pickup3;new pickupExit;public OnFilterScriptInit(){pickup3=CreatePickup(1318, 1, 2017.3345,1915.8837,12.3319);pickupExit = CreatePickup(1318, 1, 2324.9036,-1148.3251,1050.710);}public OnPlayerPickUpPickup(playerid, pickupid){ if(pickupid == pickup3) { SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083); //ide hogy hova teleportáljon SetPlayerInterior(playerid, 12); //ide az interior id-t }if(pickupid == pickupExit){ SetPlayerInterior(playerid, 0), SetPlayerPos(playerid, 2020.9922,1915.4539,12.3272);}}
#include a_samp#include zcmd#include sscanf2#include dini#define File(%1) format(vehfile, sizeof(vehfile), \"VehSystem/%s.ini\", GetName(%1))enum vehicle { Color1, Color2, Paintjob, NumberPlate[9]}new VEHICLE[MAX_VEHICLES][vehicle], vehfile[128]; public OnPlayerSpawn(playerid) { File(playerid); if(dini_Exists(vehfile)) { new Float: Pos[4], vehid, color1, color2, paintjob, numplate[9], tunes[128]; vehid = dini_Int(vehfile, \"Model\"); color1 = dini_Int(vehfile, \"Color1\"); color2 = dini_Int(vehfile, \"Color2\"); paintjob = dini_Int(vehfile, \"Paintjob\"); Pos[0] = dini_Float(vehfile, \"VehX\"); Pos[1] = dini_Float(vehfile, \"VehY\"); Pos[2] = dini_Float(vehfile, \"VehZ\"); Pos[3] = dini_Float(vehfile, \"VehA\"); format(numplate, sizeof(numplate), \"%s\", dini_Get(vehfile, \"Numberplate\")); new vehicleid = CreateVehicle(vehid, Pos[0], Pos[1], Pos[2], Pos[3], color1, color2, -1); SetPVarInt(playerid, \"MyVehicle\", vehicleid); SetVehicleNumberPlate(vehicleid, numplate); SetVehicleVirtualWorld(GetPVarInt(playerid, \"MyVehicle\"), GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(GetPVarInt(playerid, \"MyVehicle\"), GetPlayerInterior(playerid)); for(new i; i < 14; i++) { format(tunes, 32, \"Tune%i\", i); AddVehicleComponent(vehicleid, dini_Int(vehfile, tunes)); } ChangeVehiclePaintjob(vehicleid, paintjob); } return 1;}CMD:createvehicle(playerid, params[]) { new model, color1, color2, paintjob, numplate[9], mycar, Float: Pos[4]; if(sscanf(params, \"iiiis[9]\", model, color1, color2, paintjob, numplate)) return SendClientMessage(playerid, -1, \"Használat: /createvehicle [Model ID] [szín 1] [szín 2] [Festõmunka] [Rendszám]\"); if(strlen(numplate) > return SendClientMessage(playerid, 0xFF4646AA, \"-- A rendszám maximum 8 karakterbõl állhat!\"); if(color1 > 255) return SendClientMessage(playerid, 0xFF4646AA, \"-- A szín1 maximum 255-ig terjedhet!\"); if(color2 > 255) return SendClientMessage(playerid, 0xFF4646AA, \"-- A szín2 maximum 255-ig terjedhet!\"); if(paintjob > 6) return SendClientMessage(playerid, 0xFF4646AA, \"-- A festõmunka maximum 5-ig terjedhet!\"); GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]); if(GetPVarInt(playerid, \"MyVehicle\") != INVALID_VEHICLE_ID) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleID(playerid) == GetPVarInt(playerid, \"MyVehicle\")) RemovePlayerFromVehicle(playerid); DestroyVehicle(GetPVarInt(playerid, \"MyVehicle\")); } SetPVarInt(playerid, \"MyVehicle\", CreateVehicle(model, Pos[0] + 2.5, Pos[1], Pos[2] + 2.5, Pos[3], color1, color2, -1)); SetVehicleNumberPlate(GetPVarInt(playerid, \"MyVehicle\"), numplate); ChangeVehiclePaintjob(GetPVarInt(playerid, \"MyVehicle\"), paintjob); PutPlayerInVehicle(playerid, GetPVarInt(playerid, \"MyVehicle\"), 0); SetVehicleVirtualWorld(GetPVarInt(playerid, \"MyVehicle\"), GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(GetPVarInt(playerid, \"MyVehicle\"), GetPlayerInterior(playerid)); mycar = GetPlayerVehicleID(playerid); VEHICLE[mycar][Color1] = color1; VEHICLE[mycar][Color2] = color2; VEHICLE[mycar][Paintjob] = paintjob; VEHICLE[mycar][NumberPlate] = numplate; return 1;}CMD:savevehicle(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), tunes[128], Float: Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]); File(playerid); if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF4646AA, \"-- Nem ülsz jármûben!\"); if(!dini_Exists(vehfile)) { dini_Create(vehfile); dini_IntSet(vehfile, \"Model\", GetVehicleModel(vehicleid)); dini_IntSet(vehfile, \"Color1\", VEHICLE[vehicleid][Color1]); dini_IntSet(vehfile, \"Color2\", VEHICLE[vehicleid][Color2]); dini_IntSet(vehfile, \"Paintjob\", VEHICLE[vehicleid][Paintjob]); dini_Set(vehfile, \"NumberPlate\", VEHICLE[vehicleid][NumberPlate]); dini_FloatSet(vehfile, \"VehX\", Pos[0]); dini_FloatSet(vehfile, \"VehY\", Pos[1]); dini_FloatSet(vehfile, \"VehZ\", Pos[2]); dini_FloatSet(vehfile, \"VehA\", Pos[3]); for(new i; i < 14; i++) { format(tunes, 32, \"Tune%i\", i); dini_IntSet(vehfile, tunes, GetVehicleComponentInSlot(vehicleid, i)); } } else { dini_IntSet(vehfile, \"Model\", GetVehicleModel(vehicleid)); dini_IntSet(vehfile, \"Color1\", VEHICLE[vehicleid][Color1]); dini_IntSet(vehfile, \"Color2\", VEHICLE[vehicleid][Color2]); dini_IntSet(vehfile, \"Paintjob\", VEHICLE[vehicleid][Paintjob]); dini_Set(vehfile, \"NumberPlate\", VEHICLE[vehicleid][NumberPlate]); dini_FloatSet(vehfile, \"VehX\", Pos[0]); dini_FloatSet(vehfile, \"VehY\", Pos[1]); dini_FloatSet(vehfile, \"VehZ\", Pos[2]); dini_FloatSet(vehfile, \"VehA\", Pos[3]); for(new i; i < 14; i++) { format(tunes, 32, \"Tune%i\", i); dini_IntSet(vehfile, tunes, GetVehicleComponentInSlot(vehicleid, i)); } } SendClientMessage(playerid, 0xFFFF99AA, \"* Jármûved sikeresen elmentve!\"); return 1;}CMD:loadvehicle(playerid, params[]) { File(playerid); if(!dini_Exists(vehfile)) return SendClientMessage(playerid, 0xFF4646AA, \"-- Neked nincs mentett jármûved!\"); new Float: Pos[4], vehid, color1, color2, paintjob, numplate[9], tunes[128]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]); vehid = dini_Int(vehfile, \"Model\"); color1 = dini_Int(vehfile, \"Color1\"); color2 = dini_Int(vehfile, \"Color2\"); paintjob = dini_Int(vehfile, \"Paintjob\"); format(numplate, sizeof(numplate), \"%s\", dini_Get(vehfile, \"Numberplate\")); if(GetPVarInt(playerid, \"MyVehicle\") != INVALID_VEHICLE_ID) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleID(playerid) == GetPVarInt(playerid, \"MyVehicle\")) RemovePlayerFromVehicle(playerid); DestroyVehicle(GetPVarInt(playerid, \"MyVehicle\")); } new vehicleid = CreateVehicle(vehid, Pos[0], Pos[1], Pos[2], Pos[3], color1, color2, -1); SetPVarInt(playerid, \"MyVehicle\", vehicleid); SetVehicleNumberPlate(vehicleid, numplate); PutPlayerInVehicle(playerid, GetPVarInt(playerid, \"MyVehicle\"), 0); SetVehicleVirtualWorld(GetPVarInt(playerid, \"MyVehicle\"), GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(GetPVarInt(playerid, \"MyVehicle\"), GetPlayerInterior(playerid)); for(new i; i < 14; i++) { format(tunes, 32, \"Tune%i\", i); AddVehicleComponent(vehicleid, dini_Int(vehfile, tunes)); } ChangeVehiclePaintjob(vehicleid, paintjob); SendClientMessage(playerid, 0xFFFF99AA, \"* Mentett jármûved sikeresen betöltve!\"); return 1;} stock GetName(playerid) { new name[24+1]; GetPlayerName(playerid, name, sizeof(name)); return name;}
Sziasztok!Azt hogyan tudnám megoldani, hogy ha a játékos egy adott pozíción van akkor dobja be egy szintén megadott pozícióra ?És úgy kéne hogy ez visszafelé is mûködjön! Elõre is köszi!