DestroyVehicle(GetPlayerVehicleID(playerid));
if (strcmp(cmdtext, \"/nrg500\",true)==0){ if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x33AA33AA, \"Élvezd az új motorod\"); new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,a); CreateVehicle(522,x+1,y+1,z,a,1,1,10000); DestroyVehicle(GetPlayerVehicleID(playerid)); return 1;}
new NRG[MAX_PLAYERS]; //A main föléif(!strcmp(cmdtext, \"/nrg\", true))//OnPlayerCommandTexthez{ new Float:x,Float:y,Float:z,Float:a;if( NRG[playerid] > 0 ) DestroyVehicle(NRG[playerid]);if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);GetPlayerPos(playerid,x,y,z);GetPlayerFacingAngle(playerid, a);NRG[playerid] = CreateVehicle(522, x, y , z, a, 0,0, 5000000);PutPlayerInVehicle(playerid, NRG[playerid], 0);SetVehiclePos(NRG[playerid], x, y, z);SetVehicleZAngle(NRG[playerid], a);SetVehicleHealth(NRG[playerid], 1000.0); LinkVehicleToInterior(NRG[playerid], GetPlayerInterior(playerid));SendClientMessage(playerid,0x0066FFAA, \"NRG500 lekérve!\");return 1;}
Tökéletesen értelmezted,szileni kódja hibás:Ezzel elpusztítod azt a jármuvet amiben ülsz,nem azt amiben ültél. new NRG[MAX_PLAYERS]; //A main föléif(!strcmp(cmdtext, \"/nrg\", true))//OnPlayerCommandTexthez{ new Float:x,Float:y,Float:z,Float:a;if( NRG[playerid] > 0 ) DestroyVehicle(NRG[playerid]);if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);GetPlayerPos(playerid,x,y,z);GetPlayerFacingAngle(playerid, a);NRG[playerid] = CreateVehicle(522, x, y , z, a, 0,0, 5000000);PutPlayerInVehicle(playerid, NRG[playerid], 0);SetVehiclePos(NRG[playerid], x, y, z);SetVehicleZAngle(NRG[playerid], a);SetVehicleHealth(NRG[playerid], 1000.0); LinkVehicleToInterior(NRG[playerid], GetPlayerInterior(playerid));SendClientMessage(playerid,0x0066FFAA, \"NRG500 lekérve!\");return 1;} Nem teszteltem de elvileg muködik.
new NRG[MAX_PLAYERS]; //A main föléif(!strcmp(cmdtext, \"/nrg\", true))//OnPlayerCommandTexthez{ new Float:P[4];if( NRG[playerid] > 0 ) DestroyVehicle(NRG[playerid]);if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);GetPlayerPos(playerid,P[0],P[1],P[2]);GetPlayerFacingAngle(playerid, P[3]);NRG[playerid] = CreateVehicle(522,P[0],P[1],P[2], P[3], -1,-1,-1);PutPlayerInVehicle(playerid, NRG[playerid], 0); LinkVehicleToInterior(NRG[playerid], GetPlayerInterior(playerid));SendClientMessage(playerid,0x0066FFAA, \"NRG500 lekérve!\");return 1;}