- 0
Войдите для возможности подписаться
Подписчики
0
Отсутствует команда Sellcar (в гос)
Вопросы
Лучший ответ
Команда :
CMD:sellcar(playerid, params[])
{
if(!pData[playerid][pCar]) return SendClientMessage(playerid,CGRAY,"У вас нет личного т/с");
new carID = GetCarSlot(pData[playerid][pCar]); new vehicleid = gCars[carID][carVid]; new modelid = GetVehicleModel(vehicleid) - 400;
new price = floatround(gTransport[modelid][trPrice]/100*80);
SetPVarInt(playerid,"psellcarPrice",price);
SetPVarInt(playerid,"psellcarID",carID);
new mes[228];
format(mes,sizeof(mes),"\t\t\t{"#cWHITE"}Вы хотите продать свой автомобиль за {"#cGREEN"}$%d?\n\n\t\t\t\t\t{FFFF00}• [Подсказка] •\n\t{"#cWHITE"}Чтобы продать автомобиль другому игроку используйте команду /sellmycar [id] [цена]",price);
ShowPlayerDialog(playerid,dSellCar,0,"Продажа автомобиля",mes,"Продать","Отмена");
return 1;
}
Диалог:
case dSellCar:
{
if(!response) return 1;
new price = GetPVarInt(playerid,"psellcarPrice");
new carID = GetPVarInt(playerid,"psellcarID");
new vehicleid = gCars[carID][carVid];
DeletePVar(playerid,"psellcarPrice");
DeletePVar(playerid,"psellcarID");
new query[256];
format(query,sizeof(query),"DELETE FROM `cars` WHERE `id` = '%d'",pData[playerid][pCar]);
sql_query(zConn, query);
UpdatePlayerData(playerid,"car",0);
pData[playerid][pCar] = 0;
DestroyVehicle(vehicleid);
gCars[carID][carOwnerid] = 0;
gCars[carID][carMysqlID] = 0;
gCars[carID][carModelid] = 0;
gCars[carID][carFuel] = 0.0;
gCars[carID][carDrived] = 0.0;
gCars[carID][carHealth] = 0.0;
gCars[carID][carColor1] = 0;
gCars[carID][carColor2] = 0;
gCars[carID][carVid] = INVALID_VEHICLE_ID;
strdel(gCars[carID][carPlate],0,12);
TransferMoney(-1,playerid,price,"gossellcar");
new str[40]; new string[128];
format(str, sizeof(str), "~g~ +%d$",price);
GameTextForPlayer(playerid,str,2000,1);
format(string, sizeof(string), "Ваше транспортное средство продано государству за {0099FF}%d$",price);
SendClientMessage(playerid, 0x66CC00FF, string);
}
Вопрос был решен в личных сообщениях на форуме.
Эта тема закрыта для публикации ответов.
Войдите для возможности подписаться
Подписчики
0
-
Последние посетители 0 пользователей онлайн
Ни одного зарегистрированного пользователя не просматривает данную страницу
-
Похожий контент
-
От patrickk
Всем привет, решил написать dm сервер и довольно хорошим получился, даже на голову выше Goat dm. Оставил не решенную проблему тем что у меня есть 4 локации с rp run и cj run ну а как добавить cj бег на те локации не знаю и как эта система работает. Надеюсь мне помогут знающие люди
-
От Samolet
Здраствуйте, cоздаю копию Arizona на ОМП, опен мультиплеер, загрузил и подключил бд, но сервер не хочет вот лог :[2026-10-20T21:03:32+0300] [Info] Log file reloaded. Starting open.mp server (1.5.8.3079) from commit c6759bd8d265171ae3d86598895a23d5a8d92a3b Loading component $CAPI.so Successfully loaded component C-API (1.5.8.3079) with UID 10467dd8d4c56fc6 Loading component LegacyConfig.so Successfully loaded component LegacyConfig (1.5.8.3079) with UID 24ef6216838f9ffc Loading component NPCs.so Successfully loaded component NPCs (1.5.8.3079) with UID 3d0e59e87f4e90bc Loading component Recordings.so Successfully loaded component Recordings (1.5.8.3079) with UID 871144d399f5f613 Loading component Checkpoints.so Successfully loaded component Checkpoints (1.5.8.3079) with UID 44a937350d611dde Loading component TextDraws.so Successfully loaded component TextDraws (1.5.8.3079) with UID 9b5dc2b1d15c992a Loading component Pawn.so Successfully loaded component Pawn (1.5.8.3079) with UID 78906cd9f19c36a6 Loading component GangZones.so Successfully loaded component GangZones (1.5.8.3079) with UID b3351d11ee8d8056 Loading component Actors.so Successfully loaded component Actors (1.5.8.3079) with UID c81ca021eae2ad5c Loading component Pickups.so Successfully loaded component Pickups (1.5.8.3079) with UID cf304faa363dd971 Loading component Dialogs.so Successfully loaded component Dialogs (1.5.8.3079) with UID 44a111350d611dde Loading component Objects.so Successfully loaded component Objects (1.5.8.3079) with UID 59f8415f72da6160 Loading component Console.so Successfully loaded component Console (1.5.8.3079) with UID bfa24e49d0c95ee4 Loading component TextLabels.so Successfully loaded component TextLabels (1.5.8.3079) with UID a0c57ea80a009742 Loading component Variables.so Successfully loaded component Variables (1.5.8.3079) with UID 75e121848bc01fa2 Loading component Databases.so Successfully loaded component Databases (1.5.8.3079) with UID 80092e7eb5821a96 Loading component LegacyNetwork.so Successfully loaded component RakNetLegacyNetwork (1.5.8.3079) with UID ea9799fd79cf8442 Loading component CustomModels.so Successfully loaded component CustomModels (1.5.8.3079) with UID 15e3cb1e7c77ffff Loading component Menus.so Successfully loaded component Menus (1.5.8.3079) with UID 621e219eb97ee0b2 Loading component Vehicles.so Successfully loaded component Vehicles (1.5.8.3079) with UID 3f1f62ee9e22ab19 Loading component Classes.so Successfully loaded component Classes (1.5.8.3079) with UID 8cfb3183976da208 Loading component Timers.so Successfully loaded component Timers (1.5.8.3079) with UID 2ad8124c5ea257a3 Loaded 22 component(s) from /home/gs113492/components Executing Server Config... [2026-10-20T21:03:33+0300] [Info] Loading plugin: crashdetect.so [2026-10-20T21:03:33+0300] [Info] CrashDetect plugin 4.19 [2026-10-20T21:03:33+0300] [Info] Loading plugin: mapandreas.so [2026-10-20T21:03:33+0300] [Info] Loading plugin: streamer.so [2026-10-20T21:03:33+0300] [Info] *** Streamer Plugin v2.9.4 by Incognito loaded *** [2026-10-20T21:03:33+0300] [Info] Loading plugin: sscanf.so [2026-10-20T21:03:33+0300] [Info] [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] sscanf plugin loaded. [2026-10-20T21:03:33+0300] [Info] Version: 2.8.3 [2026-10-20T21:03:33+0300] [Info] (c) 2018 Alex "Y_Less" Cole [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] Loading plugin: TOTP.so [2026-10-20T21:03:33+0300] [Info] TOTP plugin v1.0.1 by Games loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: mysql_static.so [2026-10-20T21:03:33+0300] [Info] >> plugin.mysql: R39-6 successfully loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: libpawn_json.so [2026-10-20T21:03:34+0300] [Error] Function not registered: YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_RegAlias [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Reset [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_RegHandler [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Delete [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_New [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_IgnoreBits [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_Init [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendRPC [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendPacket [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_WriteValue [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ReadValue [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Info] Legacy Network started on ***.**.**.***:2717. Помогите пожалуйста
-
edikzver Свой человек 9
Доброго времени суток,у меня такая проблема возникла ,взял я мод ,начал по тихоньку баги исправлять,и тут наткнулся на такую капость как отсутствие команды Sellcar.
Она как бы есть (Sellmycar) но она позволяет продать транспорт игроку,а вот слить в гос нет возможности,прошу вашей помощи,как быть?
CMD:sellmycar(playerid, params[]) { if(!pTemp[playerid][pLogined]) return 1; if(!pData[playerid][pCar]) return SendClientMessage(playerid,CGRAY,"У Вас нет т/с"); new slot = GetCarSlot(pData[playerid][pCar]); new Float:x, Float:y, Float:z; new vehicleid = gCars[slot][carVid]; GetVehiclePos(vehicleid,x,y,z); new Float:x2,Float:y2,Float:z2; GetPlayerPos(playerid,x2,y2,z2); if(PointToPoint3D(x,y,z,x2,y2,z2) > 3.0) return SendClientMessage(playerid,CGRAY,"Вы далеко от своего т/с"); if(sscanf(params, "udd",params[0],params[1])) return SendClientMessage(playerid, CYELLOW, "• [Подсказка]:{"#cWHITE"} /sellmycar [id] [цена]"); new carID = GetCarSlot(pData[playerid][pCar]); if(carID == -1) return SendClientMessage(playerid,CRED,"Ошибка. Т/С не найдено"); if(pTemp[playerid][pTaxiID] != INVALID_VEHICLE_ID || pTemp[playerid][pTaxiPass] != INVALID_PLAYER_ID) return SendClientMessage(playerid,CGRAY,"Нельзя использовать данную Команду сейчас"); new modelid = GetVehicleModel(vehicleid) - 400; if(params[0] == playerid || !IsPlayerConnected(params[0])) return SendClientMessage(playerid,CGRAY,"Неверный ID игрока"); if(!pData[params[0]][pHouse] && !pData[params[0]][pGarajePlayer]) return 1; if(pData[params[0]][pHouse]) { new houseid = pData[params[0]][pHouse] - 1; if(gHouses[houseid][houseOwnerID] != pData[params[0]][pMysqlID]) { if(!pData[params[0]][pGarajePlayer]) return SendClientMessage(playerid,CGRAY,"Машина может быть только у владельца дома"); } } if(pData[params[0]][pCar]) return SendClientMessage(playerid,CGRAY,"У игрока уже есть своя машина."); if(GetPlayerDistanceToPlayer(playerid,params[0]) > 3.0 || GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(params[0])) return SendClientMessage(playerid,CGRAY,"Вы далеко друг от друга"); new classname[12]; new mes[158]; GetCarClassName(gTransport[modelid][trClass],classname); if(params[1]< 1000 || params[1] > gTransport[modelid][trPrice]) { new goscena[128]; format(goscena,sizeof(goscena), "Цена не может быть меньше 1000$ и больше %d$", gTransport[modelid][trPrice]); SendClientMessage(playerid,CGRAY,goscena); return 1; } format(mes,sizeof(mes),"Вы предложили {FF6600}%s{3399FF} купить Ваше транспортное средство за {00CC00}%d$ {FE2E2E}.",pData[params[0]][pNickname],params[1]); SendClientMessage(playerid,0x3399FFFF,mes); format(mes,sizeof(mes),"%s предлагает Вам купить его транспортное средство за {00CC00}%d$ {FE2E2E}.",pData[playerid][pNickname],params[1]); SendClientMessage(params[0],0x3399FFFF,mes); format(mes,sizeof(mes),"Название: {00CC00}%s {3399FF}| Класс: {00CC00}%s {3399FF}| Гос.Цена: {00CC00}%d$",gTransport[modelid][trName],classname,gTransport[modelid][trPrice]); SendClientMessage(params[0],0x3399FFFF,mes); SendClientMessage(params[0],-1, "Нажмите {00CC00}Y "W"чтобы согласиться или {FF6600}N "W"для отказа"); pTemp[playerid][pSellCarOffer] = playerid; pTemp[params[0]][pSellCarOffer] = playerid; pTemp[params[0]][pSellCarOffee] = params[0]; pTemp[params[0]][pSellCarPrice] = params[1]; pTemp[params[0]][pSellCarID] = carID; return true; }Поделиться сообщением
Ссылка на сообщение