Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:sellcarto(playerid, params[])
- {
- if(LogatPin[playerid] == 0) return SCM(playerid, -1, "Contul tau este {ff0000}blocat{ffffff}, foloseste {ff0000}/pin{ffffff} pentru a-l debloca");
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
- if(PlayerInfo[playerid][pPcarkey] == 0 && PlayerInfo[playerid][pmotokey] == 0 && PlayerInfo[playerid][phelikey] == 0 && PlayerInfo[playerid][pprcarkey] == 0 && PlayerInfo[playerid][pprcarkey2] == 0 && PlayerInfo[playerid][pPPluscarkey] == 0 && PlayerInfo[playerid][pPPluscarkey2] == 0) return SendClientMessage(playerid,COLOR_WHITE,"{FFB870}You do not have a vehicle.");
- new id,price,sendername[30],giveplayer[30],VehI = OwnedVeh(GetPlayerVehicleID(playerid)),other[128];
- if(sscanf(params, "uiS(NULL)", id,price,other)) return SCM(playerid,COLOR_WHITE,"{00FFFF}Syntax: {ffffff}/sellcarto <Name/Playerid> <price>");
- if(strcmp(other, "NULL", true)) return SCM(playerid,COLOR_WHITE,"Nu folosi spatii in pret.");
- if(id == playerid) return SendClientMessage(playerid,COLOR_WHITE,"Nu iti poti vinde masina singur.");
- if(price < 1 || price > 500000000) return SendClientMessage(playerid, COLOR_GREY, "{FFB870}Price not lower then 1 and not higher then $500,000,000.");
- new vid = GetPlayerVehicleID(playerid);
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Nu esti in masina personala.");
- if(vid != personalcar[0][playerid] && vid != personalcar[1][playerid] && vid != personalcar[2][playerid] && vid != personalcar[3][playerid] && vid != personalcar[4][playerid] && vid != personalcar[5][playerid]) return SendClientMessage(playerid, COLOR_WHITE, "Nu esti in masina personala.");
- if(GetPlayerCash(id) < price) return SCM(playerid,COLOR_WHITE,"{FFB870}This player don't have money needed.");
- if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You don't have level 3.");
- if(PlayerInfo[id][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}That player doesn't have level 3.");
- if(VehI != PlayerInfo[playerid][pPcarkey] && VehI != PlayerInfo[playerid][pmotokey] && VehI != PlayerInfo[playerid][pprcarkey] && VehI != PlayerInfo[playerid][pprcarkey2] && VehI != PlayerInfo[playerid][pPPluscarkey] && VehI != PlayerInfo[playerid][pPPluscarkey2])
- return SendClientMessage(playerid, COLOR_WHITE, "This is not your car.");
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(id, giveplayer, sizeof(giveplayer));
- if(IsPlayerConnected(id))
- {
- if(IsPlayerInRangeOfPlayer(playerid, id, 5.0))
- {
- new vehh = GetPlayerVehicleID(playerid),string[256];
- if(vehh == personalcar[0][playerid])
- {
- primesccar[id] = 1;
- CarID[id] = OwnedVeh(personalcar[0][playerid]);
- }
- if(vehh == personalcar[1][playerid])
- {
- primesccar[id] = 2;
- CarID[id] = OwnedVeh(personalcar[1][playerid]);
- }
- if(vehh == personalcar[2][playerid])
- {
- primesccar[id] = 3;
- CarID[id] = OwnedVeh(personalcar[2][playerid]);
- }
- if(vehh == personalcar[3][playerid])
- {
- primesccar[id] = 4;
- CarID[id] = OwnedVeh(personalcar[3][playerid]);
- }
- if(vehh == personalcar[4][playerid])
- {
- primesccar[id] = 5;
- CarID[id] = OwnedVeh(personalcar[4][playerid]);
- }
- if(vehh == personalcar[5][playerid])
- {
- primesccar[id] = 6;
- CarID[id] = OwnedVeh(personalcar[5][playerid]);
- }
- new vehhh = OwnedVeh(GetPlayerVehicleID(playerid));
- if(vehhh == PlayerInfo[playerid][pPcarkey])
- {
- cartype[id] = 1;
- }
- if(vehhh == PlayerInfo[playerid][pmotokey])
- {
- cartype[id] = 2;
- }
- if(vehhh == PlayerInfo[playerid][pprcarkey])
- {
- cartype[id] = 3;
- }
- if(vehhh == PlayerInfo[playerid][pprcarkey2])
- {
- cartype[id] = 4;
- }
- if(vehhh == PlayerInfo[playerid][pPPluscarkey])
- {
- cartype[id] = 5;
- }
- if(vehhh == PlayerInfo[playerid][pPPluscarkey2])
- {
- cartype[id] = 6;
- }
- ofercar[id] = playerid;
- carprice[id] = price;
- format(string, sizeof(string), "* You have offered your car(%s) to %s(%d) for $%s.", CarInfo[vehhh][cDescription],giveplayer,id,FormatNumber(price));
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string), "* %s offered his car(%s) to you for $%s (type /accept car %d) to buy.", sendername, CarInfo[vehhh][cDescription], FormatNumber(price),playerid);
- SendClientMessage(id, COLOR_GREEN, string);
- }
- else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Player is not near you.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement