Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/prendrearme", true) == 0)
- {
- new tmp[128];
- if(!IsPlayerConnected(playerid))
- {
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- new slot = strval(tmp);
- if(strlen(tmp) == 0)
- {
- SendClientMessage(playerid, -1, "Commande: /prendrearme <slot>");
- return 1;
- }
- new maison = -1;
- for(new i; i < MAX_HOUSES; i++)
- {
- if(!hInfo[i][hExist]) continue;
- if (IsPlayerInRangeOfPoint(playerid, 1.0, hInfo[i][hInX], hInfo[i][hInY], hInfo[i][hInZ]))
- {
- maison = i;
- break;
- }
- }
- if(maison == -1)
- {
- return SendClientMessage(playerid, COLOR_LIGHTRED, "Vous n'êtes pas dans une maison!");
- }
- if(hInfo[maison][hOwnerSQL] != pInfo[playerid][pSQL])
- {
- return SendClientMessage(playerid, COLOR_LIGHTRED, "Vous n'êtes pas dans votre maison.");
- }
- if(slot == 1)
- {
- if(hInfo[maison][hWeapon1] > 0)
- {
- GivePlayerWeapon(playerid, hInfo[maison][hWeapon1], hInfo[maison][hAmmo1]);
- hInfo[maison][hWeapon1] = 0;
- hInfo[maison][hAmmo1] = 0;
- SaveHouse(maison);
- }
- else
- {
- return SendClientMessage(playerid, COLOR_LIGHTRED, "Il n'y a pas d'arme dans ce slot.");
- }
- return 1;
- }
- else if(slot == 2)
- {
- if(hInfo[maison][hWeapon2] > 0)
- {
- GivePlayerWeapon(playerid, hInfo[maison][hWeapon1], hInfo[maison][hAmmo1]);
- hInfo[maison][hWeapon2] = 0;
- hInfo[maison][hAmmo2] = 0;
- SaveHouse(maison);
- }
- else
- {
- return SendClientMessage(playerid, COLOR_LIGHTRED, "Il n'y a pas d'arme dans ce slot.");
- }
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement