Jump to content

Dynamic

Membru
  • Posts

    35
  • Joined

  • Last visited

Everything posted by Dynamic

  1. a dat un warning 215: expression has no efect la linia BizzInfo[idx][bPriceProd]) SQLID; Am modificat eu, am pus , dupa [bPriceProd] si am inchis paranteza dupa SQLID. Sa-mi ziceti daca e bine BizzInfo[idx][bPriceProd], SQLID); A compilat perfect dar cand dau /sellbiz, /buybiz, /edit, /asellbiz nu se modifica in baza de date levelul,bani,owner etc.. Pe server merge sa modifici, dar in baza de date nu se schimba, cred ca tot la OnPropUpdate e problema.
  2. public LoadBizz() { new idx; new Cache: r = mysql_query( mysql_db, "SELECT * FROM `bizz`" ); if( !cache_get_row_count( mysql_db ) ) return cache_delete( r ), print( "Nu ai niciun biz in baza de date." ); for( new i = 0; i < cache_get_row_count( mysql_db ); i++ ){ BizzInfo[i][bOwned] = cache_get_field_content_int( i, "Owned", mysql_db ); cache_get_field_content( i, "Owner", BizzInfo[i][bOwner], mysql_db, MAX_PLAYER_NAME ); cache_get_field_content( i, "Message", BizzInfo[i][bMessage], mysql_db, MAX_PLAYER_NAME ); cache_get_field_content( i, "Extortion", BizzInfo[i][bExtortion], mysql_db, MAX_PLAYER_NAME ); BizzInfo[i][bEntranceX] = cache_get_field_content_float( i, "EntX", mysql_db ); BizzInfo[i][bEntranceY] = cache_get_field_content_float( i, "EntY", mysql_db ); BizzInfo[i][bEntranceZ] = cache_get_field_content_float( i, "EntZ", mysql_db ); BizzInfo[i][bExitX] = cache_get_field_content_float( i, "ExtX", mysql_db ); BizzInfo[i][bExitY] = cache_get_field_content_float( i, "ExtY", mysql_db ); BizzInfo[i][bExitZ] = cache_get_field_content_float( i, "ExtZ", mysql_db ); BizzInfo[i][bLevelNeeded] = cache_get_field_content_int( i, "Level", mysql_db ); BizzInfo[i][bBuyPrice] = cache_get_field_content_int( i, "Price", mysql_db ); BizzInfo[i][bEntranceCost] = cache_get_field_content_int( i, "EPrice", mysql_db ); BizzInfo[i][bTill] = cache_get_field_content_int( i, "Till", mysql_db ); BizzInfo[i][bLocked] = cache_get_field_content_int( i, "Locked", mysql_db ); BizzInfo[i][bInterior] = cache_get_field_content_int( i, "Interior", mysql_db ); BizzInfo[i][bProducts] = cache_get_field_content_int( i, "Products", mysql_db ); BizzInfo[i][bMaxProducts] = cache_get_field_content_int( i, "MaxProducts", mysql_db ); BizzInfo[i][bPriceProd] = cache_get_field_content_int( i, "ProductPrice", mysql_db ); printf("BizzInfo:%d Owner:%s Message:%s Entfee:%d Till:%d Products:%d/%d Interior:%d.\n", idx, BizzInfo[idx][bOwner], BizzInfo[idx][bMessage], BizzInfo[idx][bEntranceCost], BizzInfo[idx][bTill], BizzInfo[idx][bProducts], BizzInfo[idx][bMaxProducts], BizzInfo[idx][bInterior]); idx++; } cache_delete( r ); return 1; } public OnPropUpdate() { new Cache: r = mysql_query( mysql_db, "SELECT * FROM `bizz`" ); if( cache_get_row_count( mysql_db ) ){ idx = 0; for( new i = 0; i < cache_get_row_count( mysql_db ); i++ ){ idx = cache_get_field_content_int( i, "ID", mysql_db ) - 1; format( string, sizeof(string), "UPDATE `bizz` SET `Owned` = %d, `Owner` = '%s', `Message` = '%s', `Extortion` = '%s', EntX = %f, EntY = %f, EntZ = %f, ExtX = %f, ExtY = %f, ExtZ = %f, Level = %d, Price = %d, EPrice = %d, Till = %d, Locked = %d, Interior = %d, Products = %d, MaxProducts = %d, ProductPrice = %d WHERE ID = %d", BizzInfo[idx][bOwned], BizzInfo[idx][bOwner], BizzInfo[idx][bMessage], BizzInfo[idx][bExtortion], BizzInfo[idx][bEntranceX], BizzInfo[idx][bEntranceY], BizzInfo[idx][bEntranceZ], BizzInfo[idx][bExitX], BizzInfo[idx][bExitY], BizzInfo[idx][bExitZ], BizzInfo[idx][bLevelNeeded], BizzInfo[idx][bBuyPrice], BizzInfo[idx][bEntranceCost], BizzInfo[idx][bTill], BizzInfo[idx][bLocked], BizzInfo[idx][bInterior], BizzInfo[idx][bProducts], BizzInfo[idx][bMaxProducts], BizzInfo[idx][bPriceProd]); mysql_tquery( mysql_db, string ); if(BizzInfo[idx][bOwned] == 0) { format(string, sizeof(string), "{2EAD15}%s\n {2EAD15} For Sale\n {2EAD15}Level: {FFFFFF}%d\n {2EAD15}Valoare: {FFFFFF}%d\n{2EAD15} /buybiz",BizzInfo[idx][bMessage],BizzInfo[idx][bLevelNeeded],BizzInfo[idx][bBuyPrice]); } else { format(string, sizeof(string), "{F5E618}%s\n {F5E618}Owner: {FFFFFF}%s\n {F5E618}Exto: {FFFFFF}%s\n {F5E618}Level: {FFFFFF}%d\n {F5E618}Fee: {FFFFFF}%d\n {F5E618}Valoare: {FFFFFF}%d\n{F5E618} Press Enter or F",BizzInfo[idx][bMessage],BizzInfo[idx][bOwner],BizzInfo[idx][bExtortion],BizzInfo[idx][bLevelNeeded],BizzInfo[idx][bEntranceCost],BizzInfo[idx][bBuyPrice]); } Update3DTextLabelText(BizLabel[idx] ,0x008080FF, string); } } cache_delete( r );
  3. Salutare, Am un gamemode mysql r39-2 si problema este ca, atunci cand dau /edit la un biz sa ii schimb levelu sau descrierea, etc.. sau daca-l cumpar toate bizurile au in baza de date acelasi id, nume, pozitie(entx, enty, entz, extx, exty, extz). M-am tot chinuit am incercat o gramada de metode.
  4. Nick: Dynamic Problema: am luat sistemul AVS de pe net l-am bagat totul ok bag dealership, masini, imi cumpar masina personala problema e ca nu o face personala apoi cand dau rr la server face masina personala dar se este inchisa si zice ca nu e a mea Erori / warnings: - Lini/script: [pawn]public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(!ispassenger) { new id = GetVehicleID(vehicleid); if(IsValidVehicle(id) && VehicleCreated[id] == VEHICLE_PLAYER) { new msg[128]; format(msg, sizeof(msg), "This vehicle belongs to %s", VehicleOwner[id]); SendClientMessage(playerid, COLOR_GREY, msg); } } return 1; }[/pawn] Ai incercat sa rezolvi singur ?: da
  5. Nick: Dynamic Problema: am luat scriptul de pe net si am vrut sa-l modific incat sa scot liniile care blocheaza repetarea cuvintelor si sa pun doar timer de 2 secunde intre cuvinte sa nu se faca spam la fel ca aici: dar tot nu am reusit Erori / warnings: nu Lini/script: [pawn]//---------------------------[includuri]---------------------------------------- #include <a_samp> //---------------------------[Defineuri]---------------------------------------- // Mesajul pe care il trimite cand face spam: #define text2_antispam "[Anti-Spam]: Nu mai scrie mesaje asa de repede!" // Mesajul pe care il trimite cand se repeta #define text1_antispam "[Anti-Spam]: Nu te repeta!" // Culoarea textului de mai jos, acum este portocaliu #define culoare_warning_antispam 0xFF9900AA // Timpul in milisecunde dintre mesajele considerate ca spam (1000 milisecunde = 1 secunda) #define timp_antispam 2000 // Daca e adevarat, verifica timpul dintre mesaje de 2 ori (recomandabil) #define verifica_dedouaori_antispam true // Comenteaza asta daca vrei ca playerii sa nu fie avertizati cand fac spam #define avertizeaza_player_antispam // Comenteaza asta daca nu vrei ca playerii care fac spam sa fie blocati (nu e recomadabil sa comentati asta) #define blocheaza_mesaj_antispam // Comenteaza asta daca nu vrei ca playerii care fac spam sa primeasca kick #define kick_player_antispam // De-comenteaza asta daca vrei ca adminii RCON sa fie lasati sa faca spam //#define adminii_potfacespam_antispam //-----------------------------[Enumuri]---------------------------------------- enum Playeri_Spam { Ultimul_Mesaj[256], Ultimul_Tick, Tipul_Ultimului_Mesaj // 0: nu e spam - 1: se repeta - 2: flood } //------------------------------[Newuri]---------------------------------------- new PlayeriSpam[MAX_PLAYERS][Playeri_Spam]; //---------------------------[Publicuri]---------------------------------------- public OnFilterScriptInit() { print("FS-ul anti-spam s-a incarcat."); return 1; } public OnPlayerConnect(playerid) { PlayeriSpam[playerid][ultimul_Tick] = 0; return 1; } public OnPlayerText(playerid, text[]) { if(FacePlayerulSpam(playerid, text)) { #if defined adminii_potfacespam_antispam if(IsPlayerAdmin(playerid)) { return 1; } #endif #if defined avertizeaza_player_antispam switch(PlayeriSpam[playerid][Tipul_Ultimului_Mesaj]) { case 1: { SendClientMessage(playerid, culoare_warning_antispam, text1_antispam); } case 2: { SendClientMessage(playerid, culoare_warning_antispam, text2_antispam); } } #endif #if defined blocheaza_mesaj_antispam return 0; #else return 1; #endif } return 1; } //----------------------------[stockuri]---------------------------------------- stock FacePlayerulSpam(playerid, mesaj[]) { if(!PlayeriSpam[playerid][ultimul_Tick]) { PlayeriSpam[playerid][ultimul_Tick] = GetTickCount(); PlayeriSpam[playerid][Tipul_Ultimului_Mesaj] = 0; format(PlayeriSpam[playerid][ultimul_Mesaj], 128, "%s", mesaj); return 0; } if (!strcmp(mesaj, PlayeriSpam[playerid][ultimul_Mesaj], false)) { PlayeriSpam[playerid][Tipul_Ultimului_Mesaj] = 1; return 1; } if (GetTickCount() - PlayeriSpam[playerid][ultimul_Tick] < timp_antispam) { #if verifica_dedouaori_antispam PlayeriSpam[playerid][ultimul_Tick] = GetTickCount(); #endif PlayeriSpam[playerid][Tipul_Ultimului_Mesaj] = 2; return 1; } PlayeriSpam[playerid][Tipul_Ultimului_Mesaj] = 0; format(PlayeriSpam[playerid][ultimul_Mesaj], 128, "%s", mesaj); PlayeriSpam[playerid][ultimul_Tick] = GetTickCount(); return 0; }[/pawn] Ai incercat sa rezolvi singur ?: da Va rog sa ma ajutati sa-mi spuneti ce ar trebuii sa fac/modific sa iasa asa cum vreau eu
  6. nobody eu vreau sa se seteze automat sa nu am masini personale la inregistrare, nu am chef la fiecare lume sa fac la fel. comanda e in gamemode gireada
  7. comanda ta e cam aiurea incearca asta: [pawn]if(strcmp(cmd, "/gotols", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pJailed] == 1) { SendClientMessage(playerid, COLOR_2RED, "Nu te poti teleporta atata timp cat esti in INCHISOARE!"); return 1; if (PlayerInfo[playerid][pAdminServer] >= 1 || PlayerInfo[playerid][pHelperLevel] >= 2) { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 1529.6,-1691.2,13.3); } SendClientMessage(playerid, COLOR_GRAD1, " You have been teleported !"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); } } return 1; }[/pawn]
  8. poi creez vehicul si cand dau /v buy zice ca am deja 3 masini personale
  9. Incearca asta: [pawn]SendMail("****************@yahoo.com",str1);[/pawn] daca nu merge incearca asta: [pawn]SendMail(str2,"****************@yahoo.com",str1);[/pawn]
  10. cand ii dai /makeleader la cineva in pd trebuie sa-i dai si /setteam 2 si apoi merge /gov.
  11. am o problema cu sistemul de masini personale a lui im_bank. l-am setat tot sa pot crea masini etc. merg masinile le face personale, problema e ca atunci cand ma conectez pe server si scriu /mycars zice ca am masini personale. toate functiile [pPcarkey] = -1; sunt setate asa pe -1 cum e normal si la conectare tot. nu stiu de ce zice ca am masini personale cand scriu /mycars aici e sistemul: DOWNLOAD
  12. posteaza liniile de la fiecare "prostie" care te enerveaza
  13. trebuie sa descarci includeul morphic.inc si sa il adaugi in fisierul cu serverul/pawno/include apoi dai compile si gata
  14. intrii in my documents/gta san andreas/samp/savedposition.txt si acolo ai ceva ca mine dar nu sunt la fel coordonatele: [pawn]AddPlayerVehicle(289,2510.8674,-1652.2653,13.8139,138.2369,1,2); //[/pawn] atentie! asta e doar un exemplu tu copiezi ultima linie care o ai acolo in savedposition.txt de acolo copiezi linia aia intri in gm si la public ongamemodeinit dai mai jos unde mai vezi si atele addstaticvehicle si o adaugi acolo. apoi compilezi gm dupa cum te-am invatat mai sus si gata. daca team ajutat da-mi +1
  15. tu trebuie sa compilezi gm-ul ca sa ti se salveze scripturile care le modifici in el. poate nu stii cum sa compilez o sa-ti explic acum. deci tu ai in partea stanga la pawno un meniu in meniul acela ai un ecran de ala cu bara albastra si in dreapta lui o sageata albastra cu pozitia spre dreapta tu trebuie sa apesi pe una din ele si astepti pana compileaza gm-ul.
  16. cauta la functia /admins format(string, 128, "1339: %s ", sendername); si 1339 modifica cu Owner la functia /o la fel si altele unde mai arata.
  17. posteaza fiecare linie unde iti da eroare pe rand
  18. la /goto modifici linia aceasta: format(string, sizeof(string), " Admin {F81414}%s {AFAFAF}has teleported at you!",sendername); cu aceasta format(string, sizeof(string), " Admin/Helper %s {AFAFAF}has teleported at you!",sendername); si la /gethere modifici linia aceasta: SendClientMessage(plo, COLOR_GRAD1, " You have been teleported"); cu aceasta: SendClientMessage(plo, COLOR_GRAD1, "You have been teleported to admin/helper");
  19. scuzati off-topic ma rezolvat problema. am pus comenzile invers din greseala:))
  20. dupa cum spune si titlul am o problema cu hq nu merge comanda /enter. am pus pickup + coordonate dar nu stiu de ce nu merge else if (PlayerToPoint(5.0, playerid,2576.4580,-1303.0576,1060.9844)) { if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { SetPlayerInterior(playerid,2); SetPlayerPos(playerid,2345.5955,-1215.9672,22.5000); GameTextForPlayer(playerid, "~w~Welcome to The Triads HQ", 5000, 1); } } coordonate: 2345.5955,-1215.9672,22.5000 // enter triads hq 2576.4580,-1303.0576,1060.9844 // triads hq
  21. gata am rezolvat ms mult toxic dar mai am o problema sa nu deschid alt topic postez tot aici imi da un warning la fast-event warningu: [pawn]C:\Documents and Settings\Administrator\My Documents\Downloads\server by Dynamic\gamemodes\gf-dynamic.pwn(58645) : warning 235: public function lacks forward declaration (symbol "ReactionTest")[/pawn] linia la care da warning [pawn]public ReactionTest() // aici da warningu { KillTimer(ReactionTimer); new string[80]; if(PassiveMode == PASSIVE_OFF) { new Rstr[] = "aAbBcCdDeEfFgGhHIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789";//Characters that will appear in the reaction test. Small "i" removed as it looks the same as a capital "i" in game. for (new i = 0; i < 9; i++)ReactionString = Rstr[random(sizeof(Rstr))]; ReactionCash = random( MAX_WINNINGS - MIN_WINNINGS ) + MIN_WINNINGS; } else PassiveMode = PASSIVE_OFF; ReactionState = R_STATE_ACTIVE; format(string,sizeof(string),"{FFFFFF}** Primul care scrie{00CC00} %s {FFFFFF}castiga {00CC00}%d$!",ReactionString,ReactionCash); SendClientMessageToAll(0xDA1800FF,string); ReactionTimer = SetTimer("ReactionTest",REACTION_TIME*1000*60,true); return 1; }[/pawn]
  22. [pawn] C:\Documents and Settings\Administrator\My Documents\Downloads\server by Dynamic\gamemodes\gf-dynamic.pwn(18404) : error 017: undefined symbol "cValue" C:\Documents and Settings\Administrator\My Documents\Downloads\server by Dynamic\gamemodes\gf-dynamic.pwn(18404) : error 017: undefined symbol "paintjob" C:\Documents and Settings\Administrator\My Documents\Downloads\server by Dynamic\gamemodes\gf-dynamic.pwn(18404) : error 017: undefined symbol "LoadComponents" C:\Documents and Settings\Administrator\My Documents\Downloads\server by Dynamic\gamemodes\gf-dynamic.pwn(18404) : fatal error 107: too many error messages on one line [/pawn]
  23. am o problema cu masinile personale am 2 comenzi in gm una cu /v create si una cu /av care numa la owner merge. cand isi creeaza careva masina personala cu /vcreate nu merge si knd creez eu cu /av setez owneru setez owned: 1 si knd sa intru in masina zice vehicul personal a lui Dynamic si nu ma lasa. Help pls scriptu cu /av [pawn]if(strcmp(cmd, "/av", true) == 0 || strcmp(cmd, "/avehicle", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first ! "); return 1; } new x_nr[64]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/av)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: destroy, create, edit, info"); return 1; } if(PlayerInfo[playerid][pAdmin] >= 1338) { if(strcmp(x_nr, "destroy", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: destroy [car id]"); return 1; } new car; new text[20]; car = strval(tmp); if(CarInfo[car][cOwned] == 0) { SendClientMessage(playerid, COLOR_GRAD2, "This is not an ownable car!"); return 1; } CarInfo[car][cOwned] = 0; text = "No-One"; strmid(CarInfo[car][cOwner], text, 0, strlen(text), 999); SendClientMessage(playerid, COLOR_WHITE, "* You sold this car!"); DestroyVehicle(car); SaveCar(car); } else if(strcmp(x_nr,"create",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [carmodel] [color1] [color2]"); return 1; } new model; model = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [carmodel] [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [carmodel] [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } new car = 0; for(new h = 760; h < sizeof(CarInfo); h++) { if(CarInfo[h][cOwned] == 0) { car = h; h = 1500; } } format(string, 128, "cars/%d.ini", car); new Float:AX,Float:AY,Float:AZ,Float:Angle; GetPlayerPos(playerid, AX,AY,AZ); GetPlayerFacingAngle(playerid, Angle); if(dini_Exists(string)) { CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; new text[20]; text = "No-One"; strmid(CarInfo[car][cOwner], text, 0, strlen(text), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = model; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } else { dini_Create(string); CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; new text[20]; text = "No-One"; strmid(CarInfo[car][cOwner], text, 0, strlen(text), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = model; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } ownedcar[car] = CreateVehicle(CarInfo[car][cModel],CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300); SendClientMessage(playerid, COLOR_GRAD2, "Type /avehicle to view the vehicle manual!"); } else if(strcmp(x_nr,"edit",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /edit [statcode] [amount]"); SendClientMessage(playerid, COLOR_GRAD4, "|1 ID |2 Model |3 Owner |4 Owned "); return 1; } new stat; stat = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /edit [statcode] [amount]"); SendClientMessage(playerid, COLOR_GRAD4, "|1 ID |2 Model |3 Owner |4 Owned "); return 1; } new amount; amount = strval(tmp); if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehid = GetPlayerVehicleID(playerid); if(IsAnPersonalCar(vehid)) { switch (stat) { case 1: { CarInfo[vehid][cID] = amount; format(string, sizeof(string), " The Car ID Was Set To %d", amount); SendClientMessage(playerid, COLOR_GREY, string); } case 2: { CarInfo[vehid][cModel] = amount; format(string, sizeof(string), " The Car Model Was Set To %d", amount); SendClientMessage(playerid, COLOR_GREY, string); } case 3: { GetPlayerName(amount, sendername, sizeof(sendername)); strmid(CarInfo[vehid][cOwner], sendername, 0, strlen(sendername), 999); format(string, sizeof(string), " The Car Owner Was Set To %s", sendername); SendClientMessage(playerid, COLOR_GREY, string); } case 4: { CarInfo[vehid][cOwned] = amount; format(string, sizeof(string), " The Car Owned Was Set To %d", amount); SendClientMessage(playerid, COLOR_GREY, string); } } SaveCar(vehid); } else { SendClientMessage(playerid, COLOR_GREY, "This car isn't an personal car"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You must be in an personal car"); return 1; } } else if(strcmp(x_nr,"info",true) == 0) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehid = GetPlayerVehicleID(playerid); format(string, sizeof(string), "Owned: %d | Owner: %s | CarColor1: %d | CarColor2: %d | CarID: %d", CarInfo[vehid][cOwned], CarInfo[vehid][cOwner], CarInfo[vehid][cColorOne], CarInfo[vehid][cColorTwo], CarInfo[vehid][cID]); SendClientMessage(playerid, COLOR_WHITE, string); } } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/av)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: destroy, create, edit, info"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You must be an admin to use this command"); return 1; } } }[/pawn] Scriptu cu /v create: [pawn]if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first ! "); return 1; } if(PlayerInfo[playerid][pCarBan] == 1) { SendClientMessage(playerid, COLOR_GREY, " You'r banned to use /v commands ! "); return 1; } if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 36) { new x_nr[64]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: park, color, create"); return 1; } else if(strcmp(x_nr,"park",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new carid = GetPlayerVehicleID(playerid); if(carid == PlayerInfo[playerid][pCar]) { new Float:x,Float:y,Float:z; new Float:a; GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SaveCar(carid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"color",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } if(GetPlayerMoney(playerid) < 50000) { SendClientMessage(playerid, COLOR_GREY, " Nu ai suficienti bani!"); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehid = GetPlayerVehicleID(playerid); if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar]) { CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; ChangeVehicleColor(vehid, color1, color2); GivePlayerMoney(playerid, -50000); SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!"); SaveCar(vehid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"create",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } new car = 0; if(PlayerInfo[playerid][pCar] == 9999) { } else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!"); for(new h = 760; h < sizeof(CarInfo); h++) { if(CarInfo[h][cOwned] == 0) { car = h; h = 1300; } } new Float:AX,Float:AY,Float:AZ,Float:Angle; GetPlayerPos(playerid, AX,AY,AZ); GetPlayerFacingAngle(playerid, Angle); format(string, 128, "cars/%d.ini", car); new playername2[MAX_PLAYER_NAME]; playername2 = PlayerName(playerid); if(dini_Exists(string)) { CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } else { dini_Create(string); CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } PlayerInfo[playerid][pCar] = car; ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300); SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!"); SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!"); GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3); } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 3 si 36 ore pe server!"); return 1; } } return 1; }[/pawn]
  24. am incercat ma da nu reusesc imi da mai multe erori 26:|
×
×
  • 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.