Jump to content

[REZOLVAT] Comanda Sellcarto


MasterGuN
 Share

Recommended Posts

CMD:sellcarto(playerid, params[], help) {
{
new id,price,string[128], keyid, idd;
if(PlayerInfo[playerid][pPinLogged] == 0 && strlen(PlayerInfo[playerid][pPin]) != 1) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Contul tau este blocat. Scrie /pin pentru a il debloca si pentru a folosi aceasta comanda.");
new valid = PlayerInfo[playerid][pCarKey1] + PlayerInfo[playerid][pCarKey2] + PlayerInfo[playerid][pCarKey3] + PlayerInfo[playerid][pCarKey4] + PlayerInfo[playerid][pCarKey5];
new car1 = PlayerInfo[playerid][pCarKey1], car2 = PlayerInfo[playerid][pCarKey2], car3 = PlayerInfo[playerid][pCarKey3], car4 = PlayerInfo[playerid][pCarKey4], car5 = PlayerInfo[playerid][pCarKey5];
if(valid == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Nu ai un vehicul personal!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: You aren't in any vehicle!");
new car = GetPlayerVehicleID(playerid);


if(sscanf(params, "ui", id,price)) return SendClientMessage(playerid, COLOR_GREY, "Syntaxa: {FFFFFF}/sellcarto <Name/Playerid> <price>");
if(car == CarInfo[car1][Spawned]) idd = PlayerInfo[playerid][pCarKey1], keyid = 1;
if(car == CarInfo[car2][Spawned]) idd = PlayerInfo[playerid][pCarKey2], keyid = 2;
if(car == CarInfo[car3][Spawned]) idd = PlayerInfo[playerid][pCarKey3], keyid = 3;
if(car == CarInfo[car4][Spawned]) idd = PlayerInfo[playerid][pCarKey4], keyid = 4;
if(car == CarInfo[car5][Spawned]) idd = PlayerInfo[playerid][pCarKey5], keyid = 5;
if(idd == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Acest vehicul nu iti apartine!");
if(CarInfo[idd][Spawned] != car) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Nu esti in vehiculul tau personal");
if(CarInfo[idd][cSpecial] == 1) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Acces denined!");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Acel player nu este conectat.");
if(id == playerid) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: You cannot sell car to yourself!");
if(FindCSlot(id) == -1) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Player have 5 vehicles!");
if(PlayerInfo[id][pCash] < price) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Player doesn't have enough money!");
format(string, sizeof(string), "* You offerd %s to buy your car for $%s .", GetName(id), FormatNumber(price));
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Car Owner %s offered you to buy his/her car for $%s (type /accept car %d) to buy.", GetName(playerid), FormatNumber(price), playerid);
SendClientMessage(id, COLOR_WHITE, string);
OwnableCarOffered[id] = playerid;
OwnableCarOffer[playerid] = id;
OwnableCarID[id] = idd;
OwnableCarSlot[id] = keyid;
OwnableCarPrice[id] = price;
return 1;
}

 

 
O adaptezi tu pentru gamemode-ul tău.
Edited by Fuhrer
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...