Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/cofano", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new x_nr[256];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr))
- {
- SendClientMessage(playerid, COLOR_WHITE, "USA: /cofano [oggetto]");
- SendClientMessage(playerid, COLOR_WHITE, "Oggetti: info, mettiarma, prendiarma, mettiarmatura, prendiarmatura");
- return 1;
- }
- if(strcmp(x_nr,"apri",true) == 0)
- {
- new counter = 0;
- new result;
- new plyName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,plyName,MAX_PLAYER_NAME);
- for(new i; i != MAX_VEHICLES; i++)
- {
- new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
- if(dist)
- {
- result = i;
- counter++;
- }
- }
- switch(counter)
- {
- case 0:
- {
- SendClientMessage(playerid,COLOR_GREY, " Nessuna macchina con il cofano ti è vicina");
- }
- case 1:
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " Non puoi aprire il cofano da dentro la macchina");
- }
- if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner]) && strcmp(plyName, VehicleInfo3[result][vOwner]))
- {
- SendClientMessage(playerid, COLOR_GREY, " Questo non è il tuo veicolo!");
- return 1;
- }
- if(cofano[result] == 0)
- SetVehicleParamsEx(result,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
- cofano[result] = 1;
- PlayerActionMessage(15.0,playerid,"apre il cofano del suo veicolo");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Il cofano del veicolo è chiuso");
- }
- default:
- {
- SendClientMessage(playerid, COLOR_GREY, " Ci sono più macchine vicino a te,allontanati");
- }
- }
- return 1;
- }
- else if(strcmp(x_nr,"info",true) == 0)
- {
- new counter = 0;
- new result;
- new plyName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
- for(new i; i != MAX_VEHICLES; i++)
- {
- new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
- if(dist)
- {
- result = i;
- counter++;
- }
- }
- switch(counter)
- {
- case 0:
- {
- SendClientMessage(playerid, COLOR_GREY, " Nessuna macchina con il cofano ti è vicina");
- }
- case 1:
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " Non puoi aprire il cofano da dentro la macchina");
- return 1;
- }
- if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner]) && strcmp(plyName, VehicleInfo3[result][vOwner]))
- {
- SendClientMessage(playerid, COLOR_GREY, " Questo non è il tuo veicolo!");
- return 1;
- }
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "|_______ Cofano _______|");
- for(new slot = 1; slot != MAX_TRUNK_SLOTS; slot++)
- {
- new gunname[100];
- if(vehTrunk[result][slot] != 0)
- {
- GetWeaponName(vehTrunk[result][slot], gunname, sizeof(gunname));
- format(string, sizeof(string), "| Slot %i: %s (Ammo: %i)", slot, gunname, vehTrunkAmmo[result][slot]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- else
- {
- format(string, sizeof(string), "| Slot %i: Vuoto (Ammo: N/A)", slot);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- }
- format(string, sizeof(string), "| Body armour: %f%", vehTrunkArmour[result]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s apre il suo cofano.", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- default:
- {
- SendClientMessage(playerid, COLOR_GREY, " Ci sono più auto vicino a te, allontanati.");
- return 1;
- }
- }
- return 1;
- }
- else if(strcmp(x_nr,"mettiarma",true) == 0)
- {
- new counter = 0;
- new result;
- new plyName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
- for(new i; i != MAX_VEHICLES; i++)
- {
- new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
- if(dist)
- {
- result = i;
- counter++;
- }
- }
- switch(counter)
- {
- case 0:
- {
- SendClientMessage(playerid, COLOR_GREY, " Nessuna macchina con il cofano ti è vicina");
- }
- case 1:
- {
- if(vehTrunkCounter[result] != (MAX_TRUNK_SLOTS-1))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " Non puoi aprire il cofano da dentro la macchina");
- return 1;
- }
- if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner])&& strcmp(plyName, VehicleInfo3[result][vOwner]))
- {
- SendClientMessage(playerid, COLOR_GREY, " Questo non è il tuo veicolo!");
- return 1;
- }
- new buffer[512];
- new gunname[100];
- new gunID = GetPlayerWeapon(playerid);
- new gunAmmo = GetPlayerAmmo(playerid);
- if(gunID != 0 && gunAmmo != 0)
- {
- GetWeaponName(gunID, gunname, sizeof(gunname));
- vehTrunkCounter[result]++;
- vehTrunk[result][vehTrunkCounter[result]] = gunID;
- vehTrunkAmmo[result][vehTrunkCounter[result]] = gunAmmo;
- format(buffer, sizeof(buffer), "Hai messo il tuo %s (Ammo: %i) nel cofano della tua auto.", gunname, gunAmmo);
- SendClientMessage(playerid, COLOR_WHITE, buffer);
- RemovePlayerWeapon(playerid, gunID);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s apre il bagagliaio e ci mette dentro l'arma.", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Nel tuo cofano non c'entra più niente.");
- return 1;
- }
- }
- default:
- {
- SendClientMessage(playerid, COLOR_GREY, " Ci sono più auto vicino a te, allontanati.");
- return 1;
- }
- }
- return 1;
- }
- else if(strcmp(x_nr,"prendiarma",true) == 0)
- {
- new counter = 0;
- new result;
- new plyName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
- for(new i; i != MAX_VEHICLES; i++)
- {
- new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
- if(dist)
- {
- result = i;
- counter++;
- }
- }
- switch(counter)
- {
- case 0:
- {
- SendClientMessage(playerid, COLOR_GREY, " Nessuna macchina con il cofano ti è vicina");
- return 1;
- }
- case 1:
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " Non puoi aprire il cofano da dentro la macchina");
- return 1;
- }
- if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner])&& strcmp(plyName, VehicleInfo3[result][vOwner]))
- {
- SendClientMessage(playerid, COLOR_GREY, " Questo non è il tuo veicolo!");
- return 1;
- }
- if(vehTrunkCounter[result] != 0)
- {
- new buffer[512];
- new gunName[100];
- GivePlayerWeapon(playerid, vehTrunk[result][vehTrunkCounter[result]], vehTrunkAmmo[result][vehTrunkCounter[result]]);
- GetWeaponName(vehTrunk[result][vehTrunkCounter[result]], gunName, sizeof(gunName));
- format(buffer, sizeof(buffer), "Hai preso il tuo %s (Ammo: %i) dal tuo cofano.", gunName, vehTrunkAmmo[result][vehTrunkCounter[result]]);
- SendClientMessage(playerid, COLOR_WHITE, buffer);
- vehTrunk[result][vehTrunkCounter[result]] = '\0';
- vehTrunkAmmo[result][vehTrunkCounter[result]] = '\0';
- vehTrunkCounter[result]--;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s apre il cofano e prende le sue armi.", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Cofano pieno ! ");
- return 1;
- }
- }
- default:
- {
- SendClientMessage(playerid, COLOR_GREY, " Ci sono più auto vicino a te, allontanati!");
- return 1;
- }
- }
- return 1;
- }
- else if(strcmp(x_nr,"mettiarmatura",true) == 0)
- {
- new counter = 0;
- new result;
- new plyName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
- for(new i; i != MAX_VEHICLES; i++)
- {
- new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
- if(dist)
- {
- result = i;
- counter++;
- }
- }
- switch(counter)
- {
- case 0:
- {
- SendClientMessage(playerid, COLOR_GREY, " Nessuna macchina con il cofano ti è vicina");
- return 1;
- }
- case 1:
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " Non puoi aprire il cofano da dentro la macchina");
- return 1;
- }
- if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner])&& strcmp(plyName, VehicleInfo3[result][vOwner]))
- {
- SendClientMessage(playerid, COLOR_GREY, " Questo non è il tuo veicolo!");
- return 1;
- }
- new Float:plyArmour;
- GetPlayerArmour(playerid, plyArmour);
- if(plyArmour != 0)
- {
- SetPlayerArmour(playerid, 0);
- vehTrunkArmour[result] = plyArmour;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s mette il suo bodyarmour nel cofano.", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Non hai un BodyArmour nel cofano. ");
- return 1;
- }
- }
- default:
- {
- SendClientMessage(playerid, COLOR_GREY, " Ci sono più auto vicino a te, allontanati.");
- return 1;
- }
- }
- return 1;
- }
- else if(strcmp(x_nr,"prendiarmatura",true) == 0)
- {
- new counter = 0;
- new result;
- new plyName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
- for(new i; i != MAX_VEHICLES; i++)
- {
- new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
- if(dist)
- {
- result = i;
- counter++;
- }
- }
- switch(counter)
- {
- case 0:
- {
- SendClientMessage(playerid, COLOR_GREY, " Nessuna macchina con il cofano ti è vicina");
- return 1;
- }
- case 1:
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " Non puoi aprire il cofano da dentro la macchina");
- return 1;
- }
- if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner])&& strcmp(plyName, VehicleInfo3[result][vOwner]))
- {
- SendClientMessage(playerid, COLOR_GREY, " Questo non è il tuo veicolo!");
- return 1;
- }
- if(vehTrunkArmour[result] != 0)
- {
- SetPlayerArmour(playerid, vehTrunkArmour[result]);
- vehTrunkArmour[result] = 0;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s prende il suo bodyarmoru dal cofano e se lo mette.", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Non ci sono bodyarmour nel cofano ! ");
- return 1;
- }
- }
- default:
- {
- SendClientMessage(playerid, COLOR_GREY, " Ci sono più auto vicino a te, allontanati.");
- return 1;
- }
- }
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement