02.08.2018, 13:27
(
Последний раз редактировалось oghabanjb; 02.08.2018 в 17:52.
)
i dont undestand why this doesn't work
Код:
#include <a_samp> #include <zcmd> #include <mSelection> #define DIALOG_CARS 12500 #pragma tabsize 0 new planelist = mS_INVALID_LISTID; new stationlist = mS_INVALID_LISTID; new helilist = mS_INVALID_LISTID; new offroadlist = mS_INVALID_LISTID; new rclist = mS_INVALID_LISTID; new convertlist = mS_INVALID_LISTID; new bikelist = mS_INVALID_LISTID; new boatlist = mS_INVALID_LISTID; new trailerlist = mS_INVALID_LISTID; new indlist = mS_INVALID_LISTID; new saloonslist = mS_INVALID_LISTID; new publiclist = mS_INVALID_LISTID; new lowlist = mS_INVALID_LISTID; new uniqelist = mS_INVALID_LISTID; new sportlist = mS_INVALID_LISTID; public OnFilterScriptInit() { planelist = LoadModelSelectionMenu("planes.txt"); stationlist = LoadModelSelectionMenu("station.txt"); helilist = LoadModelSelectionMenu("heli.txt"); offroadlist = LoadModelSelectionMenu("offroad.txt"); rclist = LoadModelSelectionMenu("rc.txt"); convertlist = LoadModelSelectionMenu("convert.txt"); bikelist = LoadModelSelectionMenu("bike.txt"); boatlist = LoadModelSelectionMenu("boat.txt"); trailerlist = LoadModelSelectionMenu("trailer.txt"); indlist = LoadModelSelectionMenu("ind.txt"); saloonslist = LoadModelSelectionMenu("saloon.txt"); publiclist = LoadModelSelectionMenu("public.txt"); lowlist = LoadModelSelectionMenu("low.txt"); uniqelist = LoadModelSelectionMenu("uniqe.txt"); sportlist = LoadModelSelectionMenu("sport.txt"); return 1; } new SpawnedVehicles[MAX_PLAYERS]; CMD:v(playerid, params[]) { ShowPlayerDialog(playerid, DIALOG_CARS, DIALOG_STYLE_LIST, "{00FF00}Vehicles", "Station wagons\nHeli\nOff roads\nRC Vehicles\nConvertibles\nBikes\nBoats\nTrailers\nIndustrial\nAirplanes\nSaloons\nPublic Service\nSport Cars\nLoweriders\nUnique", "Ok", "Close"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 12500) { if(response) { switch(listitem) { case 0:ShowModelSelectionMenu(playerid, stationlist, "Station wagons"); case 1:ShowModelSelectionMenu(playerid, helilist, "Heli"); case 2:ShowModelSelectionMenu(playerid, offroadlist, "Offroad"); case 3:ShowModelSelectionMenu(playerid, rclist, "RC Vehicles"); case 4:ShowModelSelectionMenu(playerid, convertlist, "Convertibles"); case 5:ShowModelSelectionMenu(playerid, bikelist, "Bike"); case 6:ShowModelSelectionMenu(playerid, boatlist, "Boat"); case 7:ShowModelSelectionMenu(playerid, trailerlist, "Trailers"); case 8:ShowModelSelectionMenu(playerid, indlist, "Industrial"); case 9:ShowModelSelectionMenu(playerid, planelist, "Planes"); case 10:ShowModelSelectionMenu(playerid, saloonslist, "Saloons"); case 11:ShowModelSelectionMenu(playerid, publiclist, "Public service"); case 12:ShowModelSelectionMenu(playerid, sportlist, "Sport cars"); case 13:ShowModelSelectionMenu(playerid, lowlist, "Loweriders"); case 14:ShowModelSelectionMenu(playerid, uniqelist, "Unique"); } } } return 0; } public OnPlayerModelSelection(playerid, response, listid, modelid) { if(listid == stationlist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == helilist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == offroadlist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == rclist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == convertlist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == bikelist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == boatlist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == trailerlist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == indlist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == planelist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == saloonslist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == publiclist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == sportlist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == lowlist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } if(listid == uniqelist) { if(response) { if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); SpawnedVehicles[playerid] = CreateVehicle(modelid, x, y, z, a, random(255), random(255), -1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); } return 1; } return 1; } public OnPlayerDisconnect(playerid) { DestroyVehicle(SpawnedVehicles[playerid]); SpawnedVehicles[playerid] = 0; return 0; }