Jump to content

ProAeXel

Membru
  • Posts

    53
  • Joined

  • Last visited

Everything posted by ProAeXel

  1. Am numarat sunt 756 masini pe server,am pus carsonserver=757; tot nu merge,cand dau prima oara /towcar imi aduce o masina cu acelasi model ,adica o duba,iar duba care era deja la casa ramane acolo,nu pot urca in ea nimic,in rest cu cealalta merge,ii pot da /towcar si nu se mai dubleaza.
  2. le'am numarat de 2 ori si am pus +1 la carsonserver,le mai numar si a treia oara daca spui ca de aici porneste problema
  3. Am mai adaugat eu 2 nrg-uri private pentru 2 jucatori ,acum mi'am adus aminte,probabil de la asta o fi? sa pun la carsonserver pe langa numarul pe care il am acolo +2?
  4. Nu ,dar am /v park pentru masinile cumparate de la dealership. Atunci cand imi setez masina casei,imi da un mesaj ca va fi schimbata in decursul a 48 de ore (bine,in joc dureaza mai putin) iar cand e spawnata,nu ma pot urca in ea pentru ca e blocata ,iar daca ma fac admin si dau /unlockcars sa deblochez toate masinile de pe server ,deabia atunci merge si poate fi condusa si de altcineva. Tot nu inteleg de ce imi spawneaza masina default a casei la comanda /towcar din moment ce playerul isi schimba masina cu un infernus de exemplu.
  5. new Float:HouseCarSpawns[170][4] = { {-2637.2544,165.0454,4.2919,179.9976},//House 2 {2064.4,-1694.4,13.1,271.1561},//House 1 {-2712.7625,870.3005,70.5348,89.1608},//House 2 {1109.8,-968.0,42.7,0.0},//house 3 {2497.6274,-2025.6306,13.2521,355.4281}, // House 4 {2645.0,-1990.8,13.1,180.0},//House - 5 {-2724.8965,914.8384,67.4253,110.1072},//house 6 {1910.5149,-1120.5304,25.4493,177.8350},//house 7 {828.8,-887.0,68.5,230.7095},//House 8 {2149.6,-1610.9,14.0,90.7904},//House 9 {760.1,-1687.8,4.3,180.6},//House 10 ETC..... _____________________________________________________________________________________________________ PUBLIC: CarTow(carid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInVehicle(i, carid) || HireCar == carid) { gLastDriver[carid] = 255; return 0; } } } SetVehiclePos(carid,HouseCarSpawns[carid-1][0], HouseCarSpawns[carid-1][1], HouseCarSpawns[carid-1][2]); SetVehicleZAngle(carid, HouseCarSpawns[carid-1][3]); return 1; } _____________________________________________________________________________________________________________________ if(PlayerInfo[pLocal] != 255 && PlayerInfo[pInt] != 0) { new house = PlayerInfo[pLocal]; GetPlayerPos(i, oldposx, oldposy, oldposz); if(oldposz != 0.0) { if(oldposz < 600.0) { if(house > 10000) { new tmpcar = GetPlayerVehicleID(i); if (!PlayerToPoint(6, i,1040.6,-1021.0,31.7) && house == 10001 ||!PlayerToPoint(6, i,-2720.5,217.5,4.1) && house == 10002 ||!PlayerToPoint(6, i,2644.6,-2044.9,13.3) && house == 10003) { if (GetPlayerState(i) == 2) { SetVehiclePos(tmpcar, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]); SetVehicleZAngle(tmpcar, HouseCarSpawns[tmpcar-1][3]); } else { SetPlayerPos(i, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]); } new oldcash = gSpentCash; new Total = GetPlayerMoney(i) - oldcash; printf("Total %d = GetPlayerMoney(playerid) %d - oldcash %d",Total,GetPlayerMoney(i),oldcash); new name[MAX_PLAYER_NAME]; GetPlayerName(i, name, sizeof(name)); format(string,128,"<< %s has left the homemodshop with $%s >>",name,Bani(Total)); PayLog(string); gSpentCash = 0; TelePos[0] = 0.0; TelePos[1] = 0.0; PlayerInfo[pLocal] = 255; SetPlayerInterior(i,0); PlayerInfo[pInt] = 0; Spectate = 255; } } ___________________________________________________________________________________________________________________ for(new h = 0; h < sizeof(HouseInfo); h++) { AddStaticVehicleEx(HouseInfo[h][hVec], HouseCarSpawns[h][0], HouseCarSpawns[h][1], HouseCarSpawns[h][2], HouseCarSpawns[h][3], HouseInfo[h][hVcol1], HouseInfo[h][hVcol2], 60000); gCarLock[h+1] = 1; } Astea sunt toate liniile de cod ce contin housecarspawns
  6. Daca sterg tot ce tine de functia respectiva,nu inseamna ca sterg absolut toate masinile de la case? Nu vreau sa sterg masinile default de la case,vreau doar sa nu se mai spawneze peste masina cumparata la folosirea comenzii /towcar
  7. 1. Problema intalnita (descriere): Atunci cand folosesc /towcar imi spawneaza masina default de la casa peste cea cumparata Ero(area / rile) / warning-(ul / urile): Nu am erori la compilare Liniile de cod / sursa / script-ul: if(strcmp(cmd, "/towcar", true) == 0) { if(IsPlayerConnected(playerid)) { new house = PlayerInfo[playerid][pPhousekey]; GetPlayerName(playerid, playername, sizeof(playername)); if (house != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0) { if(SBizzInfo[8][sbProducts] == 100) { GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); return 1; } if(CarTow(house+1)) { GameTextForPlayer(playerid, "~w~Car~n~~g~Towed Home~n~~r~$-1000", 5000, 1); GivePlayerMoney(playerid,-1000); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); SBizzInfo[8][sbTill] += 1000;//towcar buisness ExtortionSBiz(8, 1000); SBizzInfo[8][sbProducts]--; } else { GameTextForPlayer(playerid, "~w~Car is~n~in ~r~use", 5000, 1); } } else { GameTextForPlayer(playerid, "~w~You are not a home owner", 5000, 1); } } return 1; Ati incercat sa rezolvati singur?: Da,dar cunostintele mele in domeniul scriptingului nu sunt atat de dezvoltate. 2. Problema intalnita (descriere):Masinile de la casa sunt blocate mereu si nici proprietarul nu poate urca in ele chiar daca foloseste comanda /unlock /lock ,etc ,iar aceste masini nu sunt private,le poate conduce oricine Ero(area / rile) / warning-(ul / urile): Nu am erori la compilare Liniile de cod / sursa / script-ul: Nu prea stiu pe unde sunt:|
  8. merge,multumesc frumos de ajutor:) Se poate inchide.
  9. Multumesc pentru liniile de cod,merg destul de bine:),dar ii da slap jucatorului ,iar daca il loc de setplayerpos pun removeplayerfromvehicle,nu mai functioneaza.
  10. se salveaza ca detinator in scriptfiles/personalcars.cfg
  11. Problema intalnita (descriere): Dupa ce un jucator isi cumpara masina de la dealership,ar trebui sa fie privata,sa nu mai poata intra nimeni altcineva sa conduca.Problema e ca dupa cumpararea masinii ,aceasta poate fi condusa de oricine si nu stiu de ce... Ero(area / rile) / warning-(ul / urile): Nu am erori la compilare Liniile de cod / sursa / script-ul: if(newstate == PLAYER_STATE_DRIVER) { if(IsAnOwnableCar(newcar)) { if(CarInfo[newcar][cOwned]==1) { format(string,sizeof(string),"* Vehiculul privat al jucatorului {ffffff}%s",CarInfo[newcar][cOwner]); SendClientMessage(playerid, COLOR_ORANGE, string); if(PlayerInfo[playerid][pPcarkey] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY, "* Nu detii keyle acestei masini."); } } } } Ati incercat sa rezolvati singur?: Am incercat si nu am reusit nimic,asa ca va cer voua ajutorul:)
  12. Multumesc tuturor pentru ajutorul acordat,am rezolvat problema cu link-ul de la NoNamed. Topicul se poate inchide:)
  13. Imi poti posta un link ?
  14. // // Model Selection using previews. For SA-MP 0.3x and above. // - D0erfler 2013 // - Kye 2013 // // Version 1.1 R2 /*Functions to be used LoadModelSelectionMenu(f_name[]) HideModelSelectionMenu(playerid) ShowModelSelectionMenu(playerid, ListID, header_text[], dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA) ShowModelSelectionMenuEx(playerid, items_array[], item_amount, header_text[], extraid, Float:Xrot = 0.0, Float:Yrot = 0.0, Float:Zrot = 0.0, Float:mZoom = 1.0, dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA) */ // Callbacks forward OnPlayerModelSelection(playerid, response, listid, modelid); forward OnPlayerModelSelectionEx(playerid, response, extraid, modelid); // settings static lists #define mS_TOTAL_ITEMS 1000 // Max amount of items from all lists #define mS_TOTAL_LISTS 20 // Max amount of lists #define mS_TOTAL_ROT_ZOOM 100 // Max amount of items using extra information like zoom or rotations // settings dynamic per player lists #define mS_CUSTOM_MAX_ITEMS 20 new gCustomList[MAX_PLAYERS][mS_CUSTOM_MAX_ITEMS]; #define mS_INVALID_LISTID mS_TOTAL_LISTS #define mS_CUSTOM_LISTID (mS_TOTAL_LISTS+1) #define mS_NEXT_TEXT "Next" #define mS_PREV_TEXT "Prev" #define mS_CANCEL_TEXT "Cancel" #define mS_SELECTION_ITEMS 21 #define mS_ITEMS_PER_LINE 7 #define mS_DIALOG_BASE_X 75.0 #define mS_DIALOG_BASE_Y 130.0 #define mS_DIALOG_WIDTH 550.0 #define mS_DIALOG_HEIGHT 180.0 #define mS_SPRITE_DIM_X 60.0 #define mS_SPRITE_DIM_Y 70.0 new PlayerText:gCurrentPageTextDrawId[MAX_PLAYERS]; new PlayerText:gHeaderTextDrawId[MAX_PLAYERS]; new PlayerText:gBackgroundTextDrawId[MAX_PLAYERS]; new PlayerText:gNextButtonTextDrawId[MAX_PLAYERS]; new PlayerText:gPrevButtonTextDrawId[MAX_PLAYERS]; new PlayerText:gCancelButtonTextDrawId[MAX_PLAYERS]; new PlayerText:gSelectionItems[MAX_PLAYERS][mS_SELECTION_ITEMS]; new gSelectionItemsTag[MAX_PLAYERS][mS_SELECTION_ITEMS]; new gItemAt[MAX_PLAYERS]; #define mS_LIST_START 0 #define mS_LIST_END 1 new gLists[mS_TOTAL_LISTS][2]; // list information start/end index #define mS_ITEM_MODEL 0 #define mS_ITEM_ROT_ZOOM_ID 1 new gItemList[mS_TOTAL_ITEMS][2]; new Float:gRotZoom[mS_TOTAL_ROT_ZOOM][4]; // Array for saving rotation and zoom info new gItemAmount = 0; // Amount of items used new gListAmount = 0; // Amount of lists used new gRotZoomAmount = 0; // Amount of Rotation/Zoom informations used //------------------------------------------------ stock mS_GetNumberOfPages(ListID) { new ItemAmount = mS_GetAmountOfListItems(ListID); if((ItemAmount >= mS_SELECTION_ITEMS) && (ItemAmount % mS_SELECTION_ITEMS) == 0) { return (ItemAmount / mS_SELECTION_ITEMS); } else return (ItemAmount / mS_SELECTION_ITEMS) + 1; } //------------------------------------------------ stock mS_GetNumberOfPagesEx(playerid) { new ItemAmount = mS_GetAmountOfListItemsEx(playerid); if((ItemAmount >= mS_SELECTION_ITEMS) && (ItemAmount % mS_SELECTION_ITEMS) == 0) { return (ItemAmount / mS_SELECTION_ITEMS); } else return (ItemAmount / mS_SELECTION_ITEMS) + 1; } //------------------------------------------------ stock mS_GetAmountOfListItems(ListID) { return (gLists[ListID][mS_LIST_END] - gLists[ListID][mS_LIST_START])+1; } //------------------------------------------------ stock mS_GetAmountOfListItemsEx(playerid) { return GetPVarInt(playerid, "mS_custom_item_amount"); } //------------------------------------------------ stock mS_GetPlayerCurrentListID(playerid) { if(GetPVarInt(playerid, "mS_list_active") == 1) return GetPVarInt(playerid, "mS_list_id"); else return mS_INVALID_LISTID; } //------------------------------------------------ stock PlayerText:mS_CreateCurrentPageTextDraw(playerid, Float:Xpos, Float:Ypos) { new PlayerText:txtInit; txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, "0/0"); PlayerTextDrawUseBox(playerid, txtInit, 0); PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1); PlayerTextDrawFont(playerid, txtInit, 1); PlayerTextDrawSetShadow(playerid, txtInit, 0); PlayerTextDrawSetOutline(playerid, txtInit, 1); PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF); PlayerTextDrawShow(playerid, txtInit); return txtInit; } //------------------------------------------------ // Creates a button textdraw and returns the textdraw ID. stock PlayerText:mS_CreatePlayerDialogButton(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, button_text[]) { new PlayerText:txtInit; txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, button_text); PlayerTextDrawUseBox(playerid, txtInit, 1); PlayerTextDrawBoxColor(playerid, txtInit, 0x000000FF); PlayerTextDrawBackgroundColor(playerid, txtInit, 0x000000FF); PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1); PlayerTextDrawFont(playerid, txtInit, 1); PlayerTextDrawSetShadow(playerid, txtInit, 0); // no shadow PlayerTextDrawSetOutline(playerid, txtInit, 0); PlayerTextDrawColor(playerid, txtInit, 0x4A5A6BFF); PlayerTextDrawSetSelectable(playerid, txtInit, 1); PlayerTextDrawAlignment(playerid, txtInit, 2); PlayerTextDrawTextSize(playerid, txtInit, Height, Width); // The width and height are reversed for centering.. something the game does <g> PlayerTextDrawShow(playerid, txtInit); return txtInit; } //------------------------------------------------ stock PlayerText:mS_CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos, header_text[]) { new PlayerText:txtInit; txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, header_text); PlayerTextDrawUseBox(playerid, txtInit, 0); PlayerTextDrawLetterSize(playerid, txtInit, 1.25, 3.0); PlayerTextDrawFont(playerid, txtInit, 0); PlayerTextDrawSetShadow(playerid, txtInit, 0); PlayerTextDrawSetOutline(playerid, txtInit, 1); PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF); PlayerTextDrawShow(playerid, txtInit); return txtInit; } //------------------------------------------------ stock PlayerText:mS_CreatePlayerBGTextDraw(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, bgcolor) { new PlayerText:txtBackground = CreatePlayerTextDraw(playerid, Xpos, Ypos," ~n~"); // enough space for everyone PlayerTextDrawUseBox(playerid, txtBackground, 1); PlayerTextDrawBoxColor(playerid, txtBackground, bgcolor); PlayerTextDrawLetterSize(playerid, txtBackground, 5.0, 5.0); PlayerTextDrawFont(playerid, txtBackground, 0); PlayerTextDrawSetShadow(playerid, txtBackground, 0); PlayerTextDrawSetOutline(playerid, txtBackground, 0); PlayerTextDrawColor(playerid, txtBackground,0x000000FF); PlayerTextDrawTextSize(playerid, txtBackground, Width, Height); PlayerTextDrawBackgroundColor(playerid, txtBackground, bgcolor); PlayerTextDrawShow(playerid, txtBackground); return txtBackground; } //------------------------------------------------ // Creates a model preview sprite stock PlayerText:mS_CreateMPTextDraw(playerid, modelindex, Float:Xpos, Float:Ypos, Float:Xrot, Float:Yrot, Float:Zrot, Float:mZoom, Float:width, Float:height, bgcolor) { new PlayerText:txtPlayerSprite = CreatePlayerTextDraw(playerid, Xpos, Ypos, ""); // it has to be set with SetText later PlayerTextDrawFont(playerid, txtPlayerSprite, TEXT_DRAW_FONT_MODEL_PREVIEW); PlayerTextDrawColor(playerid, txtPlayerSprite, 0xFFFFFFFF); PlayerTextDrawBackgroundColor(playerid, txtPlayerSprite, bgcolor); PlayerTextDrawTextSize(playerid, txtPlayerSprite, width, height); // Text size is the Width:Height PlayerTextDrawSetPreviewModel(playerid, txtPlayerSprite, modelindex); PlayerTextDrawSetPreviewRot(playerid,txtPlayerSprite, Xrot, Yrot, Zrot, mZoom); PlayerTextDrawSetSelectable(playerid, txtPlayerSprite, 1); PlayerTextDrawShow(playerid,txtPlayerSprite); return txtPlayerSprite; } //------------------------------------------------ stock mS_DestroyPlayerMPs(playerid) { new x=0; while(x != mS_SELECTION_ITEMS) { if(gSelectionItems[playerid][x] != PlayerText:INVALID_TEXT_DRAW) { PlayerTextDrawDestroy(playerid, gSelectionItems[playerid][x]); gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW; } x++; } } //------------------------------------------------ stock mS_ShowPlayerMPs(playerid) { new bgcolor = GetPVarInt(playerid, "mS_previewBGcolor"); new x=0; new Float:BaseX = mS_DIALOG_BASE_X; new Float:BaseY = mS_DIALOG_BASE_Y - (mS_SPRITE_DIM_Y * 0.33); // down a bit new linetracker = 0; new mS_listID = mS_GetPlayerCurrentListID(playerid); if(mS_listID == mS_CUSTOM_LISTID) { new itemat = (GetPVarInt(playerid, "mS_list_page") * mS_SELECTION_ITEMS); new Float:rotzoom[4]; rotzoom[0] = GetPVarFloat(playerid, "mS_custom_Xrot"); rotzoom[1] = GetPVarFloat(playerid, "mS_custom_Yrot"); rotzoom[2] = GetPVarFloat(playerid, "mS_custom_Zrot"); rotzoom[3] = GetPVarFloat(playerid, "mS_custom_Zoom"); new itemamount = mS_GetAmountOfListItemsEx(playerid); // Destroy any previous ones created mS_DestroyPlayerMPs(playerid); while(x != mS_SELECTION_ITEMS && itemat < (itemamount)) { if(linetracker == 0) { BaseX = mS_DIALOG_BASE_X + 25.0; // in a bit from the box BaseY += mS_SPRITE_DIM_Y + 1.0; // move on the Y for the next line } gSelectionItems[playerid][x] = mS_CreateMPTextDraw(playerid, gCustomList[playerid][itemat], BaseX, BaseY, rotzoom[0], rotzoom[1], rotzoom[2], rotzoom[3], mS_SPRITE_DIM_X, mS_SPRITE_DIM_Y, bgcolor); gSelectionItemsTag[playerid][x] = gCustomList[playerid][itemat]; BaseX += mS_SPRITE_DIM_X + 1.0; // move on the X for the next sprite linetracker++; if(linetracker == mS_ITEMS_PER_LINE) linetracker = 0; itemat++; x++; } } else { new itemat = (gLists[mS_listID][mS_LIST_START] + (GetPVarInt(playerid, "mS_list_page") * mS_SELECTION_ITEMS)); // Destroy any previous ones created mS_DestroyPlayerMPs(playerid); while(x != mS_SELECTION_ITEMS && itemat < (gLists[mS_listID][mS_LIST_END]+1)) { if(linetracker == 0) { BaseX = mS_DIALOG_BASE_X + 25.0; // in a bit from the box BaseY += mS_SPRITE_DIM_Y + 1.0; // move on the Y for the next line } new rzID = gItemList[itemat][mS_ITEM_ROT_ZOOM_ID]; // avoid long line if(rzID > -1) gSelectionItems[playerid][x] = mS_CreateMPTextDraw(playerid, gItemList[itemat][mS_ITEM_MODEL], BaseX, BaseY, gRotZoom[rzID][0], gRotZoom[rzID][1], gRotZoom[rzID][2], gRotZoom[rzID][3], mS_SPRITE_DIM_X, mS_SPRITE_DIM_Y, bgcolor); else gSelectionItems[playerid][x] = mS_CreateMPTextDraw(playerid, gItemList[itemat][mS_ITEM_MODEL], BaseX, BaseY, 0.0, 0.0, 0.0, 1.0, mS_SPRITE_DIM_X, mS_SPRITE_DIM_Y, bgcolor); gSelectionItemsTag[playerid][x] = gItemList[itemat][mS_ITEM_MODEL]; BaseX += mS_SPRITE_DIM_X + 1.0; // move on the X for the next sprite linetracker++; if(linetracker == mS_ITEMS_PER_LINE) linetracker = 0; itemat++; x++; } } } //------------------------------------------------ stock mS_UpdatePageTextDraw(playerid) { new PageText[64+1]; new listID = mS_GetPlayerCurrentListID(playerid); if(listID == mS_CUSTOM_LISTID) { format(PageText, 64, "%d/%d", GetPVarInt(playerid,"mS_list_page") + 1, mS_GetNumberOfPagesEx(playerid)); PlayerTextDrawSetString(playerid, gCurrentPageTextDrawId[playerid], PageText); } else { format(PageText, 64, "%d/%d", GetPVarInt(playerid,"mS_list_page") + 1, mS_GetNumberOfPages(listID)); PlayerTextDrawSetString(playerid, gCurrentPageTextDrawId[playerid], PageText); } } //------------------------------------------------ stock ShowModelSelectionMenu(playerid, ListID, header_text[], dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA) { if(!(0 <= ListID < mS_TOTAL_LISTS && gLists[ListID][mS_LIST_START] != gLists[ListID][mS_LIST_END])) return 0; mS_DestroySelectionMenu(playerid); SetPVarInt(playerid, "mS_list_page", 0); SetPVarInt(playerid, "mS_list_id", ListID); SetPVarInt(playerid, "mS_list_active", 1); SetPVarInt(playerid, "mS_list_time", GetTickCount()); gBackgroundTextDrawId[playerid] = mS_CreatePlayerBGTextDraw(playerid, mS_DIALOG_BASE_X, mS_DIALOG_BASE_Y + 20.0, mS_DIALOG_WIDTH, mS_DIALOG_HEIGHT, dialogBGcolor); gHeaderTextDrawId[playerid] = mS_CreatePlayerHeaderTextDraw(playerid, mS_DIALOG_BASE_X, mS_DIALOG_BASE_Y, header_text); gCurrentPageTextDrawId[playerid] = mS_CreateCurrentPageTextDraw(playerid, mS_DIALOG_WIDTH - 30.0, mS_DIALOG_BASE_Y + 15.0); gNextButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 30.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_NEXT_TEXT); gPrevButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 90.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_PREV_TEXT); gCancelButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 150.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_CANCEL_TEXT); SetPVarInt(playerid, "mS_previewBGcolor", previewBGcolor); mS_ShowPlayerMPs(playerid); mS_UpdatePageTextDraw(playerid); SelectTextDraw(playerid, tdSelectionColor); return 1; } //------------------------------------------------------------ stock ShowModelSelectionMenuEx(playerid, items_array[], item_amount, header_text[], extraid, Float:Xrot = 0.0, Float:Yrot = 0.0, Float:Zrot = 0.0, Float:mZoom = 1.0, dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA) { mS_DestroySelectionMenu(playerid); if(item_amount > mS_CUSTOM_MAX_ITEMS) { item_amount = mS_CUSTOM_MAX_ITEMS; print("-mSelection- WARNING: Too many items given to "ShowModelSelectionMenuEx", increase "mS_CUSTOM_MAX_ITEMS" to fix this"); } if(item_amount > 0) { for(new i=0;i<item_amount;i++) { gCustomList[playerid] = items_array; } SetPVarInt(playerid, "mS_list_page", 0); SetPVarInt(playerid, "mS_list_id", mS_CUSTOM_LISTID); SetPVarInt(playerid, "mS_list_active", 1); SetPVarInt(playerid, "mS_list_time", GetTickCount()); SetPVarInt(playerid, "mS_custom_item_amount", item_amount); SetPVarFloat(playerid, "mS_custom_Xrot", Xrot); SetPVarFloat(playerid, "mS_custom_Yrot", Yrot); SetPVarFloat(playerid, "mS_custom_Zrot", Zrot); SetPVarFloat(playerid, "mS_custom_Zoom", mZoom); SetPVarInt(playerid, "mS_custom_extraid", extraid); gBackgroundTextDrawId[playerid] = mS_CreatePlayerBGTextDraw(playerid, mS_DIALOG_BASE_X, mS_DIALOG_BASE_Y + 20.0, mS_DIALOG_WIDTH, mS_DIALOG_HEIGHT, dialogBGcolor); gHeaderTextDrawId[playerid] = mS_CreatePlayerHeaderTextDraw(playerid, mS_DIALOG_BASE_X, mS_DIALOG_BASE_Y, header_text); gCurrentPageTextDrawId[playerid] = mS_CreateCurrentPageTextDraw(playerid, mS_DIALOG_WIDTH - 30.0, mS_DIALOG_BASE_Y + 15.0); gNextButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 30.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_NEXT_TEXT); gPrevButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 90.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_PREV_TEXT); gCancelButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 150.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_CANCEL_TEXT); SetPVarInt(playerid, "mS_previewBGcolor", previewBGcolor); mS_ShowPlayerMPs(playerid); mS_UpdatePageTextDraw(playerid); SelectTextDraw(playerid, tdSelectionColor); return 1; } return 0; } //------------------------------------------------ stock HideModelSelectionMenu(playerid) { mS_DestroySelectionMenu(playerid); SetPVarInt(playerid, "mS_ignore_next_esc", 1); CancelSelectTextDraw(playerid); return 1; } //------------------------------------------------ stock mS_DestroySelectionMenu(playerid) { if(GetPVarInt(playerid, "mS_list_active") == 1) { if(mS_GetPlayerCurrentListID(playerid) == mS_CUSTOM_LISTID) { DeletePVar(playerid, "mS_custom_Xrot"); DeletePVar(playerid, "mS_custom_Yrot"); DeletePVar(playerid, "mS_custom_Zrot"); DeletePVar(playerid, "mS_custom_Zoom"); DeletePVar(playerid, "mS_custom_extraid"); DeletePVar(playerid, "mS_custom_item_amount"); } DeletePVar(playerid, "mS_list_time"); SetPVarInt(playerid, "mS_list_active", 0); mS_DestroyPlayerMPs(playerid); PlayerTextDrawDestroy(playerid, gHeaderTextDrawId[playerid]); PlayerTextDrawDestroy(playerid, gBackgroundTextDrawId[playerid]); PlayerTextDrawDestroy(playerid, gCurrentPageTextDrawId[playerid]); PlayerTextDrawDestroy(playerid, gNextButtonTextDrawId[playerid]); PlayerTextDrawDestroy(playerid, gPrevButtonTextDrawId[playerid]); PlayerTextDrawDestroy(playerid, gCancelButtonTextDrawId[playerid]); gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gCancelButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; } } //------------------------------------------------ public OnPlayerConnect(playerid) { // Init all of the textdraw related globals gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; gCancelButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW; for(new x=0; x < mS_SELECTION_ITEMS; x++) { gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW; } gItemAt[playerid] = 0; return CallLocalFunction("MP_OPC", "i", playerid); } #if defined _ALS_OnPlayerConnect #undef OnPlayerConnect #else #define _ALS_OnPlayerConnect #endif #define OnPlayerConnect MP_OPC forward MP_OPC(playerid); //------------------------------------------- // Even though only Player* textdraws are used in this script, // OnPlayerClickTextDraw is still required to handle ESC public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(GetPVarInt(playerid, "mS_ignore_next_esc") == 1) { SetPVarInt(playerid, "mS_ignore_next_esc", 0); return CallLocalFunction("MP_OPCTD", "ii", playerid, _:clickedid); } if(GetPVarInt(playerid, "mS_list_active") == 0) return CallLocalFunction("MP_OPCTD", "ii", playerid, _:clickedid); // Handle: They cancelled (with ESC) if(clickedid == Text:INVALID_TEXT_DRAW) { new listid = mS_GetPlayerCurrentListID(playerid); if(listid == mS_CUSTOM_LISTID) { new extraid = GetPVarInt(playerid, "mS_custom_extraid"); mS_DestroySelectionMenu(playerid); CallLocalFunction("OnPlayerModelSelectionEx", "dddd", playerid, 0, extraid, -1); PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); } else { mS_DestroySelectionMenu(playerid); CallLocalFunction("OnPlayerModelSelection", "dddd", playerid, 0, listid, -1); PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); } return 1; } return CallLocalFunction("MP_OPCTD", "ii", playerid, _:clickedid); } #if defined _ALS_OnPlayerClickTextDraw #undef OnPlayerClickTextDraw #else #define _ALS_OnPlayerClickTextDraw #endif #define OnPlayerClickTextDraw MP_OPCTD forward MP_OPCTD(playerid, Text:clickedid); //------------------------------------------------ public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) { if(GetPVarInt(playerid, "mS_list_active") == 0 || (GetTickCount()-GetPVarInt(playerid, "mS_list_time")) < 200 /* Disable instant selection */) return CallLocalFunction("MP_OPCPTD", "ii", playerid, _:playertextid); new curpage = GetPVarInt(playerid, "mS_list_page"); // Handle: cancel button if(playertextid == gCancelButtonTextDrawId[playerid]) { new listID = mS_GetPlayerCurrentListID(playerid); if(listID == mS_CUSTOM_LISTID) { new extraid = GetPVarInt(playerid, "mS_custom_extraid"); HideModelSelectionMenu(playerid); CallLocalFunction("OnPlayerModelSelectionEx", "dddd", playerid, 0, extraid, -1); PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); } else { HideModelSelectionMenu(playerid); CallLocalFunction("OnPlayerModelSelection", "dddd", playerid, 0, listID, -1); PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); } return 1; } // Handle: next button if(playertextid == gNextButtonTextDrawId[playerid]) { new listID = mS_GetPlayerCurrentListID(playerid); if(listID == mS_CUSTOM_LISTID) { if(curpage < (mS_GetNumberOfPagesEx(playerid) - 1)) { SetPVarInt(playerid, "mS_list_page", curpage + 1); mS_ShowPlayerMPs(playerid); mS_UpdatePageTextDraw(playerid); PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0); } else { PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); } } else { if(curpage < (mS_GetNumberOfPages(listID) - 1)) { SetPVarInt(playerid, "mS_list_page", curpage + 1); mS_ShowPlayerMPs(playerid); mS_UpdatePageTextDraw(playerid); PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0); } else { PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); } } return 1; } // Handle: previous button if(playertextid == gPrevButtonTextDrawId[playerid]) { if(curpage > 0) { SetPVarInt(playerid, "mS_list_page", curpage - 1); mS_ShowPlayerMPs(playerid); mS_UpdatePageTextDraw(playerid); PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0); } else { PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); } return 1; } // Search in the array of textdraws used for the items new x=0; while(x != mS_SELECTION_ITEMS) { if(playertextid == gSelectionItems[playerid][x]) { new listID = mS_GetPlayerCurrentListID(playerid); if(listID == mS_CUSTOM_LISTID) { PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0); new item_id = gSelectionItemsTag[playerid][x]; new extraid = GetPVarInt(playerid, "mS_custom_extraid"); HideModelSelectionMenu(playerid); CallLocalFunction("OnPlayerModelSelectionEx", "dddd", playerid, 1, extraid, item_id); return 1; } else { PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0); new item_id = gSelectionItemsTag[playerid][x]; HideModelSelectionMenu(playerid); CallLocalFunction("OnPlayerModelSelection", "dddd", playerid, 1, listID, item_id); return 1; } } x++; } return CallLocalFunction("MP_OPCPTD", "ii", playerid, _:playertextid); } #if defined _ALS_OnPlayerClickPlayerTD #undef OnPlayerClickPlayerTextDraw #else #define _ALS_OnPlayerClickPlayerTD #endif #define OnPlayerClickPlayerTextDraw MP_OPCPTD forward MP_OPCPTD(playerid, PlayerText:playertextid); //------------------------------------------------------------------ stock LoadModelSelectionMenu(f_name[]) { new File:f, str[75]; format(str, sizeof(str), "%s", f_name); f = fopen(str, io_read); if( !f ) { printf("-mSelection- WARNING: Failed to load list: "%s"", f_name); return mS_INVALID_LISTID; } if(gListAmount >= mS_TOTAL_LISTS) { printf("-mSelection- WARNING: Reached maximum amount of lists, increase "mS_TOTAL_LISTS"", f_name); return mS_INVALID_LISTID; } new tmp_ItemAmount = gItemAmount; // copy value if loading fails new line[128], idxx; while(fread(f,line,sizeof(line),false)) { if(tmp_ItemAmount >= mS_TOTAL_ITEMS) { printf("-mSelection- WARNING: Reached maximum amount of items, increase "mS_TOTAL_ITEMS"", f_name); break; } idxx = 0; if(!line[0]) continue; new mID = strval( mS_strtok(line,idxx) ); if(0 <= mID < 20000) { gItemList[tmp_ItemAmount][mS_ITEM_MODEL] = mID; new tmp_mS_strtok[20]; new Float:mRotation[3], Float:mZoom = 1.0; new bool:useRotation = false; tmp_mS_strtok = mS_strtok(line,idxx); if(tmp_mS_strtok[0]) { useRotation = true; mRotation[0] = floatstr(tmp_mS_strtok); } tmp_mS_strtok = mS_strtok(line,idxx); if(tmp_mS_strtok[0]) { useRotation = true; mRotation[1] = floatstr(tmp_mS_strtok); } tmp_mS_strtok = mS_strtok(line,idxx); if(tmp_mS_strtok[0]) { useRotation = true; mRotation[2] = floatstr(tmp_mS_strtok); } tmp_mS_strtok = mS_strtok(line,idxx); if(tmp_mS_strtok[0]) { useRotation = true; mZoom = floatstr(tmp_mS_strtok); } if(useRotation) { new bool:foundRotZoom = false; for(new i=0; i < gRotZoomAmount; i++) { if(gRotZoom[0] == mRotation[0] && gRotZoom[1] == mRotation[1] && gRotZoom[2] == mRotation[2] && gRotZoom[3] == mZoom) { foundRotZoom = true; gItemList[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = i; break; } } if(gRotZoomAmount < mS_TOTAL_ROT_ZOOM) { if(!foundRotZoom) { gRotZoom[gRotZoomAmount][0] = mRotation[0]; gRotZoom[gRotZoomAmount][1] = mRotation[1]; gRotZoom[gRotZoomAmount][2] = mRotation[2]; gRotZoom[gRotZoomAmount][3] = mZoom; gItemList[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = gRotZoomAmount; gRotZoomAmount++; } } else print("-mSelection- WARNING: Not able to save rotation/zoom information. Reached maximum rotation/zoom information count. Increase '#define mS_TOTAL_ROT_ZOOM' to fix the issue"); } else gItemList[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = -1; tmp_ItemAmount++; } } if(tmp_ItemAmount > gItemAmount) // any models loaded ? { gLists[gListAmount][mS_LIST_START] = gItemAmount; gItemAmount = tmp_ItemAmount; // copy back gLists[gListAmount][mS_LIST_END] = (gItemAmount-1); gListAmount++; return (gListAmount-1); } printf("-mSelection- WARNING: No Items found in file: %s", f_name); return mS_INVALID_LISTID; } stock mS_strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }
  15. Problema intalnita (descriere): Nu mi se compileaza un fs (Gireada ,in caz ca citesti asta,este vorba despre fs-ul facut de tine ,acela pentru skin-uri) Ero(area / rile) / warning-(ul / urile): C:UsersProAeXelDesktopServer GF-RPpawnoincludemSelection.inc(192) : error 017: undefined symbol "TEXT_DRAW_FONT_MODEL_PREVIEW" C:UsersProAeXelDesktopServer GF-RPpawnoincludemSelection.inc(196) : error 017: undefined symbol "PlayerTextDrawSetPreviewModel" C:UsersProAeXelDesktopServer GF-RPpawnoincludemSelection.inc(197) : error 017: undefined symbol "PlayerTextDrawSetPreviewRot" C:UsersProAeXelDesktopServer GF-RPpawnoincludemSelection.inc(189) : warning 203: symbol is never used: "mZoom" C:UsersProAeXelDesktopServer GF-RPpawnoincludemSelection.inc(189) : warning 203: symbol is never used: "Zrot" C:UsersProAeXelDesktopServer GF-RPpawnoincludemSelection.inc(189) : warning 203: symbol is never used: "Yrot" C:UsersProAeXelDesktopServer GF-RPpawnoincludemSelection.inc(189) : warning 203: symbol is never used: "Xrot" C:UsersProAeXelDesktopServer GF-RPpawnoincludemSelection.inc(189) : warning 203: symbol is never used: "modelindex" Liniile de cod / sursa / script-ul: #include <a_samp> #include <zcmd> #include <mSelection> new skinlist = mS_INVALID_LISTID; public OnFilterScriptInit() { skinlist = LoadModelSelectionMenu("skins.txt"); print("n--------------------------------------"); print(" Skin Selector by Gireada"); print("--------------------------------------n"); return 1; } public OnFilterScriptExit() { return 1; } main() { print("n----------------------------------"); print(" Skin Selector by Gireada"); print("----------------------------------n"); } CMD:skin(playerid, params[]) { ShowModelSelectionMenu(playerid, skinlist, "Alegeti Skin-ul"); return 1; } public OnPlayerModelSelection(playerid, response, listid, modelid) { if(listid == skinlist) { if(response) { SetPlayerSkin(playerid, modelid); SendClientMessage(playerid, 0xFF0000FF, "Imi place noul tau look"); } else SendClientMessage(playerid, 0xFF0000FF, "Arati bine si asa"); return 1; } return 1; } Imagini / Video (optional): Ati incercat sa rezolvati singur?: Da,am pus alt fisier mSelection.inc,dar nimic PS: Atunci cand mor nu mai ramane skin-ul
  16. Problema intalnita (descriere): Dupa ce cumpar o masina de la dealership ,o parchez cu /v park,iar dupa restartarea serverului ,masina dispare ,dar cand scriu /mycars imi apare ca as avea cheile unei masini,dar nu se specifica ce masina. Ero(area / rile) / warning-(ul / urile): La compilare nu am absolut nici o eroare /warn Liniile de cod / sursa / script-ul: enum cInfo { cModel, Float:cLocationx, Float:cLocationy, Float:cLocationz, Float:cAngle, cColorOne, cColorTwo, cOwner[MAX_PLAYER_NAME], cDescription[12], cValue, cLicense[14], cRegistration, cOwned, cLock, mod1, mod2, mod3, mod4, mod5, mod6, mod7, mod8, mod9, mod10, mod11, mod12, mod13, mod14, mod15, mod16, mod17, paintjob, }; new CarInfo[1000][cInfo]; if(newstate == PLAYER_STATE_DRIVER) { if(IsAnOwnableCar(newcar)) { if(CarInfo[newcar][cOwned]==1) { format(string,sizeof(string),"* Vehiculul privat al jucatorului {ffffff}%s",CarInfo[newcar][cOwner]); SendClientMessage(playerid, COLOR_ORANGE, string); if(PlayerInfo[playerid][pPcarkey] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY, "* Nu detii keyFle acestei masini."); } } } } PUBLIC: OnCarUpdate() { new idx; new File: file2; idx = carsonserver; while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%dn", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo], CarInfo[idx][cOwner], CarInfo[idx][cDescription], CarInfo[idx][cValue], CarInfo[idx][cLicense], CarInfo[idx][cOwned], CarInfo[idx][cLock], CarInfo[idx][mod1], CarInfo[idx][mod2], CarInfo[idx][mod3], CarInfo[idx][mod4], CarInfo[idx][mod5], CarInfo[idx][mod6], CarInfo[idx][mod7], CarInfo[idx][mod8], CarInfo[idx][mod9], CarInfo[idx][mod10], CarInfo[idx][mod11], CarInfo[idx][mod12], CarInfo[idx][mod13], CarInfo[idx][mod14], CarInfo[idx][mod15], CarInfo[idx][mod16], CarInfo[idx][mod17], CarInfo[idx][paintjob]); if(idx == carsonserver) { file2 = fopen("personalcars.cfg", io_write); } else { file2 = fopen("personalcars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } PUBLIC: LoadCar() { new arrCoords[31][64]; new strFromFile2[256]; new File: file = fopen("personalcars.cfg", io_read); if (file) { new idx = carsonserver; while (idx < sizeof(CarInfo)) { fread(file, strFromFile2); split(strFromFile2, arrCoords, ','); CarInfo[idx][cModel] = strval(arrCoords[0]); CarInfo[idx][cLocationx] = floatstr(arrCoords[1]); CarInfo[idx][cLocationy] = floatstr(arrCoords[2]); CarInfo[idx][cLocationz] = floatstr(arrCoords[3]); CarInfo[idx][cAngle] = floatstr(arrCoords[4]); CarInfo[idx][cColorOne] = strval(arrCoords[5]); CarInfo[idx][cColorTwo] = strval(arrCoords[6]); strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255); strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255); CarInfo[idx][cValue] = strval(arrCoords[9]); strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255); CarInfo[idx][cOwned] = strval(arrCoords[11]); CarInfo[idx][cLock] = strval(arrCoords[12]); CarInfo[idx][mod1] = strval(arrCoords[13]); CarInfo[idx][mod2] = strval(arrCoords[14]); CarInfo[idx][mod3] = strval(arrCoords[15]); CarInfo[idx][mod4] = strval(arrCoords[16]); CarInfo[idx][mod5] = strval(arrCoords[17]); CarInfo[idx][mod6] = strval(arrCoords[18]); CarInfo[idx][mod7] = strval(arrCoords[19]); CarInfo[idx][mod8] = strval(arrCoords[20]); CarInfo[idx][mod9] = strval(arrCoords[21]); CarInfo[idx][mod10] = strval(arrCoords[22]); CarInfo[idx][mod11] = strval(arrCoords[23]); CarInfo[idx][mod12] = strval(arrCoords[24]); CarInfo[idx][mod13] = strval(arrCoords[25]); CarInfo[idx][mod14] = strval(arrCoords[26]); CarInfo[idx][mod15] = strval(arrCoords[27]); CarInfo[idx][mod16] = strval(arrCoords[28]); CarInfo[idx][mod17] = strval(arrCoords[29]); CarInfo[idx][paintjob] = strval(arrCoords[30]); printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]); idx++; } } return 1; } PUBLIC: SaveCarCoords() { new idx; new File: file2; while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%dn", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo], CarInfo[idx][mod1], CarInfo[idx][mod2], CarInfo[idx][mod3], CarInfo[idx][mod4], CarInfo[idx][mod5], CarInfo[idx][mod6], CarInfo[idx][mod7], CarInfo[idx][mod8], CarInfo[idx][mod9], CarInfo[idx][mod10], CarInfo[idx][mod11], CarInfo[idx][mod12], CarInfo[idx][mod13], CarInfo[idx][mod14], CarInfo[idx][mod15], CarInfo[idx][mod16], CarInfo[idx][mod17], CarInfo[idx][paintjob]); if(idx == carsonserver) { file2 = fopen("personalcars.cfg", io_write); } else { file2 = fopen("personalcars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } PUBLIC: CarKeys(playerid) { new string2[64]; new playername2[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername2, sizeof(playername2)); format(string2, sizeof(string2), "KeyMasini/%s.ini", playername2); new File: UserFile = fopen(string2, io_read); if ( UserFile ) { new key[ 256 ] , val[ 256 ]; new Data[ 256 ]; while ( fread( UserFile , Data , sizeof( Data ) ) ) { key = ini_GetKey( Data ); if( strcmp( key , "CarKey" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey] = strval( val ); } if( strcmp( key , "CarKey2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey2] = strval( val ); } if( strcmp( key , "CarKey3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey3] = strval( val ); } } fclose(UserFile); } return 1; } Ati incercat sa rezolvati singur?: Da,dar nu am obtinut nici un rezultat bun.Am cautat pe o multime de forumuri ,dar tot nimic.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.