Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DIALOG_GEPEK 25214
- CMD:trunk(playerid, params[])
- {
- new Float:x, Float:y, Float:z;
- new veh = GetClosestVehicle(playerid, 2.0);
- if(PlayerInfo[playerid][pPosedovanjeAuta] == -1) return SCM(playerid,-1,"Vi ne posjedujete vozilo!");
- if(VoziloInfo[PlayerInfo[playerid][pPosedovanjeAuta]][vID] != veh) return SCM(playerid,-1,"Niste kod svoga vozila!");
- GetPosBehindVehicle(veh, x, y, z);
- if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
- {
- SPD(playerid,DIALOG_GEPEK,DIALOG_STYLE_LIST, ""SPLAVA"Gepek", "Informacije\nOstavi u vozilu\nUzmi iz vozila", "Odaberi", "Izlaz");
- }
- return 1;
- }
- CMD:gepek(playerid, params[])
- {
- new Float:x, Float:y, Float:z;
- new veh = GetClosestVehicle(playerid, 2.0);
- GetPosBehindVehicle(veh, x, y, z);
- if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
- if(boot==0)
- {
- SendClientMessage(playerid, -1, "Otvorio si gepek.");
- SetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, 1, objective);
- }
- else
- {
- SendClientMessage(playerid, -1, "Zatvorio si gepek.");
- SetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, 0, objective);
- }
- }
- return 1;
- }
- stock GetPosBehindVehicle(vehicleid, &Float:x, &Float:y, &Float:z, Float:offset=0.5)
- {
- new Float:vehicleSize[3], Float:vehiclePos[3];
- GetVehiclePos(vehicleid, vehiclePos[0], vehiclePos[1], vehiclePos[2]);
- GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, vehicleSize[0], vehicleSize[1], vehicleSize[2]);
- GetXYBehindVehicle(vehicleid, vehiclePos[0], vehiclePos[1], (vehicleSize[1]/2)+offset);
- x = vehiclePos[0];
- y = vehiclePos[1];
- z = vehiclePos[2];
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_GEPEK)
- {
- if(!response) return 1;
- new i = PlayerInfo[playerid][pPosedovanjeAuta];
- if(PlayerInfo[playerid][pPosedovanjeAuta] == -1) return SCM(playerid,-1,"[UP:RP] "CRVENA"Ne posedujes auto!");
- switch(listitem)
- {
- case 0:
- {
- SCM(playerid,-1,""SPLAVA"||-------------------------------------------------------------------------------------------||");
- new str[256];
- format(str,sizeof(str),""SPLAVA"Oruzje: "BELA"%s | "SPLAVA"Metaka: "BELA"%d | "SPLAVA"Droga: "BELA"%dg | "SPLAVA"Materijali: "BELA"%d",GetWeapon(VoziloInfo[i][vOruzije]),VoziloInfo[i][vMunicija], VoziloInfo[i][vDroga], VoziloInfo[i][vMats]);
- SCM(playerid,-1,str);
- SCM(playerid,-1,""SPLAVA"||-------------------------------------------------------------------------------------------||");
- }
- case 1:
- {
- SPD(playerid,DIALOG_AUTOSTAVI,DIALOG_STYLE_LIST,""BELA"Ostavi u auto","Drogu\nMaterijale\nOruzje","Odaberi","Izlaz");
- }
- case 2:
- {
- SPD(playerid,DIALOG_AUTOUZMI,DIALOG_STYLE_LIST,""BELA"Uzmi iz auta","Drogu\nMaterijale\nOruzje","Odaberi","Izlaz");
- }
- }
- }
- if(dialogid == DIALOG_AUTOSTAVI)
- {
- if(!response) return 1;
- new i = PlayerInfo[playerid][pPosedovanjeAuta];
- if(PlayerInfo[playerid][pPosedovanjeAuta] == -1) return SCM(playerid,-1,"[UP:RP] "CRVENA"Ne posedujes auto!");
- switch(listitem)
- {
- case 0:
- {
- SPD(playerid,DIALOG_AODROGU,DIALOG_STYLE_INPUT,"Ostavi",""SPLAVA"Unesite kolicinu droge koju zelite da ostavite u auto (MAX 5000)...","Promeni","Izlaz");
- }
- case 1:
- {
- SPD(playerid,DIALOG_AOMATS,DIALOG_STYLE_INPUT,"Ostavi",""SPLAVA"Unesite kolicinu materijala koju zelite da ostavite u auto (MAX 5000)...","Promeni","Izlaz");
- }
- case 2:
- {
- if(VoziloInfo[i][vOruzije] != -1) return SCM(playerid,-1,""SIVA"Vec imas oruzije u vozilu!");
- if(GetPlayerWeapon(playerid) <= 0) return SCM(playerid,-1,""SIVA"Nemas oruzije u ruci!");
- VoziloInfo[i][vOruzije] = GetPlayerWeapon(playerid); VoziloInfo[i][vMunicija] = GetPlayerAmmo(playerid);
- SacuvajVozilo(i); SetPlayerAmmo(playerid, GetPlayerWeapon(playerid), 0);
- }
- }
- }
- if(dialogid == DIALOG_AUTOUZMI)
- {
- if(!response) return 1;
- new i = PlayerInfo[playerid][pPosedovanjeAuta];
- if(PlayerInfo[playerid][pPosedovanjeAuta] == -1) return SCM(playerid,-1,"[UP:RP] "CRVENA"Ne posedujes auto!");
- switch(listitem)
- {
- case 0:
- {
- SPD(playerid,DIALOG_AUDROGU,DIALOG_STYLE_INPUT,"Uzmi",""SPLAVA"Unesite kolicinu droge koju zelite da uzmete iz auta...","Promeni","Izlaz");
- }
- case 1:
- {
- SPD(playerid,DIALOG_AUMATS,DIALOG_STYLE_INPUT,"Uzmi",""SPLAVA"Unesite kolicinu materijala koju zelite da uzmete...","Promeni","Izlaz");
- }
- case 2:
- {
- if(VoziloInfo[i][vOruzije] == -1) return SCM(playerid,-1,""SIVA"Nemate oruzije u vasem vozilu!");
- g_GivePlayerWeapon(playerid,VoziloInfo[i][vOruzije],VoziloInfo[i][vMunicija]); VoziloInfo[i][vOruzije] = -1; VoziloInfo[i][vMunicija] = -1;
- SacuvajVozilo(i); SCM(playerid,-1,"UP:RP | "ZELENA"Uzeli ste oruzije iz vaseg vozila!");
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment