27.01.2018, 22:06
Код:
function LoginAccount(playerid) { //-------------------------------------------------------------------------- PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID", DB_Connect); PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level", DB_Connect); PlayerInfo[playerid][pExp] = cache_get_field_content_int(0, "Exp", DB_Connect); PlayerInfo[playerid][pPP] = cache_get_field_content_int(0, "PremiumPoints", DB_Connect); PlayerInfo[playerid][pWeapon1] = cache_get_field_content_int(0, "Weapon1", DB_Connect); PlayerInfo[playerid][pWeapon2] = cache_get_field_content_int(0, "Weapon2", DB_Connect); PlayerInfo[playerid][pWeapon3] = cache_get_field_content_int(0, "Weapon3", DB_Connect); PlayerInfo[playerid][pWeapon4] = cache_get_field_content_int(0, "Weapon4", DB_Connect); PlayerInfo[playerid][pWeapon5] = cache_get_field_content_int(0, "Weapon5", DB_Connect); PlayerInfo[playerid][pWeapon6] = cache_get_field_content_int(0, "Weapon6", DB_Connect); PlayerInfo[playerid][pWeapon7] = cache_get_field_content_int(0, "Weapon7", DB_Connect); PlayerInfo[playerid][pWeapon8] = cache_get_field_content_int(0, "Weapon8", DB_Connect); PlayerInfo[playerid][pWeapon9] = cache_get_field_content_int(0, "Weapon9", DB_Connect); PlayerInfo[playerid][pWeapon10] = cache_get_field_content_int(0, "Weapon10", DB_Connect); PlayerInfo[playerid][pWeapon11] = cache_get_field_content_int(0, "Weapon11", DB_Connect); PlayerInfo[playerid][pWeapon12] = cache_get_field_content_int(0, "Weapon12", DB_Connect); PlayerInfo[playerid][pPass] = cache_get_field_content_int(0, "Password", DB_Connect); PlayerInfo[playerid][Kills] = cache_get_field_content_int(0, "Kills", DB_Connect); PlayerInfo[playerid][Deaths] = cache_get_field_content_int(0, "Deaths", DB_Connect); PlayerInfo[playerid][hours] = cache_get_field_content_int(0, "Hours", DB_Connect); PlayerInfo[playerid][mins] = cache_get_field_content_int(0, "Minutes", DB_Connect); PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin", DB_Connect); PlayerInfo[playerid][KillingSpree] = cache_get_field_content_int(0, "KillingSpree", DB_Connect); PlayerInfo[playerid][pCar] = cache_get_field_content_int(0, "Car", DB_Connect); PlayerInfo[playerid][pHouse] = cache_get_field_content_int(0, "House", DB_Connect); PlayerInfo[playerid][pBiz] = cache_get_field_content_int(0, "Business", DB_Connect); PlayerInfo[playerid][pCash] = cache_get_field_content_int(0, "Money", DB_Connect); PlayerInfo[playerid][House] = cache_get_field_content_int(0, "House", DB_Connect); TeamInfo[playerid][TeamKills] = cache_get_field_content_int(0, "TeamKills", DB_Connect); TeamInfo[playerid][TeamDeaths] = cache_get_field_content_int(0, "TeamDeaths", DB_Connect); TeamInfo[playerid][TeamID] = cache_get_field_content_int(0, "TeamID", DB_Connect); TeamInfo[playerid][TeamName] = cache_get_field_content_int(0, "TeamName", DB_Connect); PlayerInfo[playerid][pJailed] = cache_get_field_content_int(0, "Jailed", DB_Connect); PlayerInfo[playerid][pWarns] = cache_get_field_content_int(0, "Warns", DB_Connect); PlayerInfo[playerid][pWantedLevel] = cache_get_field_content_int(0, "Wanted", DB_Connect); PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0, "Skin", DB_Connect); PlayerInfo[playerid][pMuted] = cache_get_field_content_int(0, "Muted", DB_Connect); PlayerInfo[playerid][pMuteTime] = cache_get_field_content_int(0, "MuteTime", DB_Connect); PlayerInfo[playerid][pJailTime] = cache_get_field_content_int(0, "JailTime", DB_Connect); TeamInfo[playerid][TeamRank] = cache_get_field_content_int(0, "TeamRank", DB_Connect); PlayerInfo[playerid][pScore] = cache_get_field_content_int(0, "Score", DB_Connect); //-------------------------------------------------------------------------- ResetPlayerMoney(playerid); GivePlayerMoney(playerid, cache_get_field_content_int(0, "Money", DB_Connect)); SetPlayerScore(playerid, cache_get_field_content_int(0, "Score", DB_Connect)); SetPlayerWantedLevel(playerid, cache_get_field_content_int(0, "Wanted", DB_Connect)); SetPlayerSkin(playerid, cache_get_field_content_int(0, "Skin", DB_Connect)); //-------------------------------------------------------------------------- return 1; }
Код:
C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(552) : error 017: undefined symbol "pID" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(556) : error 017: undefined symbol "pWeapon1" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(557) : error 017: undefined symbol "pWeapon2" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(558) : error 017: undefined symbol "pWeapon3" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(559) : error 017: undefined symbol "pWeapon4" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(560) : error 017: undefined symbol "pWeapon5" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(561) : error 017: undefined symbol "pWeapon6" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(562) : error 017: undefined symbol "pWeapon7" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(563) : error 017: undefined symbol "pWeapon8" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(564) : error 017: undefined symbol "pWeapon9" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(565) : error 017: undefined symbol "pWeapon10" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(566) : error 017: undefined symbol "pWeapon11" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(567) : error 017: undefined symbol "pWeapon12" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(569) : error 017: undefined symbol "Kills" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(570) : error 017: undefined symbol "Deaths" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(571) : error 017: undefined symbol "hours" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(572) : error 017: undefined symbol "mins" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(574) : error 017: undefined symbol "KillingSpree" C:\Users\Sorin\Desktop\Gamemode De La 0\gamemodes\Kernel.pwn(579) : error 017: undefined symbol "House"
BUT, I'm definied this variables(if help: The function is in bottom gamemode);
Full Gamemode:
Код:
//CREDITE: /*Acest Gamemode A Fost Creat De La 0 De LozoQ. NU PASTRATI CREDITELE!!!!!!!*/ //includes #include <a_samp> #include <foreach> #include <a_mysql> #include <ZCMD> #include <sscanf2> //COLORS #define WHITE 0xFFFFFFFF #define GREY 0xC0C0C0FF #define BLACK 0x000000FF #define PINK 0xFF82FFFF #define DPINK 0xD000E8FF #define RED 0xFF0000FF #define DRED 0xC40005FF #define ORANGE 0xFF8000FF #define YELLOW 0xFFFF00FF #define DYELLOW 0xCABB00FF #define GREEN 0x00FF00FF #define DGREEN 0x5BAE09FF #define BLUE 0x0080FFFF #define DBLUE 0x0000FFFF #define PURPLE 0xC400C4FF #define DPURPLE 0x5A1265FF #define TURCUAZ 0x00FFFFFF #define DTURCUAZ 0x0B98C1FF //Defines #define MAX_HOUSES 300 #define MAX_BIZ 100 #define MAX_PCARS 1000 #define function%0(%1) forward%0(%1); public%0(%1) //Dialogs #define DIALOG_REGISTER 1000 #define DIALOG_AREGISTER 1002 #define DIALOG_LOGIN 1003 //SQL #define localhost true #if localhost == true #define SQL_Host "localhost" #define SQL_User "root" #define SQL_Pass "" #define SQL_DB "FirstGamemode" #else #define SQL_Host "127.0.0.1" #define SQL_User "server_472" #define SQL_Pass "07062003" #define SQL_DB "server_472_mata" #endif //Stocks GetName(playerid) { new pName[MAX_PLAYER_NAME]; //-------------------------------------------------------------------------- GetPlayerName(playerid, pName, 24); //-------------------------------------------------------------------------- return pName; } //Player VARIABLES enum PlayerInfos { pExp, pLevel, pAdmin, pCash, pHP, pAR, pWeapon[13], pCar, pHouse, pBiz, pPP, pKills, pDeaths, pMuted, pMuteTime, pWantedLevel, pWarns, pJailed, pJailTime, pPass[24], pSkin, pScore, pFailLogin } new PlayerInfo[MAX_PLAYERS][PlayerInfos]; //Team Variables enum TeamInfos { TeamKills, TeamDeaths, TeamID, TeamName[24], TeamRank, TeamColor, TeamWeapon[7], TeamPos[4], Float:CaptureX, Float:CaptureY, Float:CaptureZ, TeamCapturing, TeamCaptureTime } new TeamInfo[MAX_PLAYERS][TeamInfos]; //House Variables enum HouseInfos { hID, hOwner[24], hLocked, hCost ,Float:hPos[4], Float:hIcon[4], hInt, hPickup, Text3D:HouseData } new HouseInfo[MAX_HOUSES][HouseData]; //Business Variables enum BizInfos { bID, bName[24], bOwner[24], bCost, bIncome, Float:bPos[4], Float:bIcon[4], bInt, bPickup, bMapIcon, Text3D:BizData } new BizInfo[MAX_BIZ][BizInfos]; //Car Variables enum CarInfos { cID, cOwner[24],cKM, cFuel, cColor1, cDays, cColor2, Float:cPos[5], cLocked, cModel } new CarInfo[MAX_PCARS][CarInfos]; //Car Names new vNames[212][] = { "Landstalker","Bravura","Buffalo","Linerunner","Perennial","Sentinel","Dumper","Firetruck","Trashmaster","Stretch", "Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi", "Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator", "Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RC Bandit", "Romero", "Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed", "Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider", "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler", "ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper", "Rancher","FBI Rancher","Virgo","Greenwood","Jetmax","Hotring Racer","Sandking","Blista Compact","Police Maverick", "Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT", "Elegant","Journey","Bike","Mountain Bike","Beagle","Cropduster","Stuntplane","Tanker","Road Train","Nebula","Majestic", "Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV-1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck", "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent", "Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility", "Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger", "Flash","Tahoma","Savanna","Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway", "Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer","Emperor","Wayfarer", "Euros","Hotdog","Club","Trailer","Trailer","Andromada","Dodo","RCCam","Launch","Police Car (LSPD)","Police Car (SFPD)", "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A", "Luggage Trailer B","Stair Trailer","Boxville","Farm Plow","Utility Trailer" }; //random messages new RandomMessages[][] = { "Ai Vazut vreun hacker? Scrie /report si un admin se va ocupa de el!(Primesti recompensa.)", "Nu abuza de buguri,se pedepseste cu BAN 3 zile!", "Daca raportezi un bug adevarat(/bug),vei primii o recompensa!", "Daca vrei sa faci un ban cinstit,scrie /JOBS!", "De la nivel 2 iti poti cumpara o masina de la Dealership!", "Vrei sa pariezi la ruleta? Casinoul este perfect pentru asta!", "Vrei sa devii admin si nu ai bani? Poti contacta fondatorul nostru: LozoQ!", "Te pricepi la arme? Atunci iate la 'tranchilizante' cu un agent S.W.A.T!", "Folosirea hack-urilor este interzisa,se pedepseste cu BAN 10 ZILE!", "Daca ai o problema poti scrie /n si un admin te va ajuta cu placere!" }; //Server Variables new DB_Connect, eQuery[824], eString[3048], MaxWarnings = 3, randommessagestimer; public OnGameModeInit() { DB_Connect = mysql_connect(SQL_Host, SQL_User, SQL_DB, SQL_Pass); mysql_log(LOG_ERROR | LOG_DEBUG | LOG_WARNING, LOG_TYPE_TEXT); for(new hi = 0; hi < MAX_HOUSES; hi++) { //---------------------------------------------------------------------- HouseInfo[hi][hID] = 0, HouseInfo[hi][hOwner] = 0, HouseInfo[hi][hLocked] = 0, HouseInfo[hi][hCost] = 0, HouseInfo[hi][hInt] = 0, HouseInfo[hi][hPos][1] = 0, HouseInfo[hi][hPos][2] = 0, HouseInfo[hi][hPos][3] = 0, HouseInfo[hi][hIcon][1] = 0, HouseInfo[hi][hIcon][2] = 0, HouseInfo[hi][hIcon][3] = 0, HouseInfo[hi][hPickup] = 0; //---------------------------------------------------------------------- } //-------------------------------------------------------------------------- for(new pID = 0; pID < MAX_BIZ; pID++) { //---------------------------------------------------------------------- BizInfo[pID][bID] = 0, BizInfo[pID][bName] = 0, BizInfo[pID][bOwner] = 0, BizInfo[pID][bCost] = 0, BizInfo[pID][bInt] = 0, BizInfo[pID][bPos][1] = 0, BizInfo[pID][bPos][2] = 0, BizInfo[pID][bPos][3] = 0, BizInfo[pID][bIcon][1] = 0, BizInfo[pID][bIcon][2] = 0, BizInfo[pID][bIcon][3] = 0, BizInfo[pID][bPickup] = 0, BizInfo[pID][bMapIcon] = 0; } for(new vID = 0; vID < MAX_PCARS; vID++) { //---------------------------------------------------------------------- CarInfo[vID][cID] = 0, CarInfo[vID][cOwner] = 0, CarInfo[vID][cColor1] = 0, CarInfo[vID][cColor2] = 0, CarInfo[vID][cPos][1] = 0, CarInfo[vID][cPos][2] = 0, CarInfo[vID][cPos][3] = 0, CarInfo[vID][cPos][4] = 0, CarInfo[vID][cLocked] = 0, CarInfo[vID][cDays] = 0, CarInfo[vID][cKM] = 0, CarInfo[vID][cFuel] = 0, CarInfo[vID][cModel] = 0; //---------------------------------------------------------------------- } randommessagestimer = SetTimer("RandomMessageTimer", 365000, true); SetGameModeText("LOS SANTOS ACTION!"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; } public OnGameModeExit() { foreach(new i: Player) OnPlayerDisconnect(i, 1); mysql_close(DB_Connect); KillTimer(randommessagestimer); return 1; } public OnPlayerRequestClass(playerid, classid) { switch(classid) { case 0: GameTextForPlayer(playerid, "~r~~h~Mafiot", 3000, 6); case 1: GameTextForPlayer(playerid, "~c~~h~S.W.A.T", 3000, 6); case 2: GameTextForPlayer(playerid, "~r~~h~Criminal", 3000, 6); case 3: GameTextForPlayer(playerid, "~c~~h~Politist", 3000, 6); case 4: GameTextForPlayer(playerid, "~p~~h~Reporter", 3000, 6); case 5: GameTextForPlayer(playerid, "~g~~h~Soldat", 3000, 6); case 6: GameTextForPlayer(playerid, "~y~~h~Doctor", 3000, 6); } return 1; } public OnPlayerConnect(playerid) { PlayerInfo[playerid][pCash] = 0; PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pHP] = 0; PlayerInfo[playerid][pAR] = 0; PlayerInfo[playerid][pWeapon][1] = 0; PlayerInfo[playerid][pWeapon][2] = 0; PlayerInfo[playerid][pWeapon][3] = 0; PlayerInfo[playerid][pWeapon][4] = 0; PlayerInfo[playerid][pWeapon][5] = 0; PlayerInfo[playerid][pWeapon][6] = 0; PlayerInfo[playerid][pWeapon][7] = 0; PlayerInfo[playerid][pWeapon][8] = 0; PlayerInfo[playerid][pWeapon][9] = 0; PlayerInfo[playerid][pWeapon][10] = 0; PlayerInfo[playerid][pWeapon][11] = 0; PlayerInfo[playerid][pWeapon][12] = 0; PlayerInfo[playerid][pCar] = 0; PlayerInfo[playerid][pHouse] = 0; PlayerInfo[playerid][pBiz] = 0; PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pWantedLevel] = 0; PlayerInfo[playerid][pWarns] = 0; PlayerInfo[playerid][pJailed] = 0; PlayerInfo[playerid][pJailTime] = 0; PlayerInfo[playerid][pPP] = 0; PlayerInfo[playerid][pMuted] = 0; PlayerInfo[playerid][pMuteTime] = 0; PlayerInfo[playerid][pKills] = 0; PlayerInfo[playerid][pDeaths] = 0; PlayerInfo[playerid][pExp] = 0; PlayerInfo[playerid][pSkin] = 0; PlayerInfo[playerid][pScore] = 0; PlayerInfo[playerid][pLevel] = 0; PlayerInfo[playerid][pPass] = 0; PlayerInfo[playerid][pFailLogin] = 0; TeamInfo[playerid][TeamID] = 0; TeamInfo[playerid][TeamKills] = 0; TeamInfo[playerid][TeamDeaths] = 0; TeamInfo[playerid][TeamRank] = 0; TeamInfo[playerid][TeamName] = 0; TeamInfo[playerid][TeamColor] = 0; TeamInfo[playerid][TeamPos][1] = 0; TeamInfo[playerid][TeamPos][2] = 0; TeamInfo[playerid][TeamPos][3] = 0; TeamInfo[playerid][CaptureX] = 0; TeamInfo[playerid][CaptureY] = 0; TeamInfo[playerid][CaptureZ] = 0; TeamInfo[playerid][TeamCapturing] = 0; TeamInfo[playerid][TeamCaptureTime] = 0; TeamInfo[playerid][TeamWeapon][1] = 0; TeamInfo[playerid][TeamWeapon][2] = 0; TeamInfo[playerid][TeamWeapon][3] = 0; TeamInfo[playerid][TeamWeapon][4] = 0; TeamInfo[playerid][TeamWeapon][5] = 0; TeamInfo[playerid][TeamWeapon][6] = 0; foreach(Player, i) { new string[50], name[24]; GetPlayerName(playerid, name, 24); format(string, 50, "%s s-a conectat!", name); SendClientMessage(i, YELLOW, string); } return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // Do something here return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new stringtext[100]; format(stringtext,sizeof(stringtext),"~r~~h~~h~~h~~h~%s",vNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]); GameTextForPlayer(playerid, stringtext, 5000, 1); return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_REGISTER) { new rPassword[24], liYear, liMonth, liDay, rQuery[4096], sStr[500], sStr2[500]; //------------------------------------------------------------------ if(!response) { Kick(playerid); } if(sscanf(inputtext, "s[24]", rPassword)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "EROARE", "{00FF00}Scrie parola pe care ti-o doresti,\n{FFFF00}Aceasta parola trebuie sa fie intre {FF0000}6-24{FFFF00} caractere!", "Inregistrare", "Iesire"); if(strlen(rPassword) < 6 || strlen(rPassword) > 24) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "EROARE", "{00FF00}Scrie parola pe care ti-o doresti,\n{FFFF00}Aceasta parola trebuie sa fie intre {FF0000}6-24{FFFF00} caractere!", "Inregistrare", ""); //------------------------------------------------------------------ if(strfind(rPassword, "'", true) != -1) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "EROARE", "{00FF00}Aceasta parola nu poate contine simboluri: {FF0000}('){FFFF00}!", "Inregistrare", ""); //------------------------------------------------------------------ getdate(liYear, liMonth, liDay); ResetPlayerMoney(playerid), GivePlayerMoney(playerid, 25000), SetPlayerScore(playerid, 100); //------------------------------------------------------------------ //MySQL INSERT new stringip[30]; GetPlayerIp(playerid, stringip, 30); //------------------------------------------------------------------ format(rQuery, 4096, "INSERT INTO `Conturi` (`ID`, `Name`, `Password`, `IP`, `RegisterDate`, `Level`, `Exp`, `Cash`, `Score`, `Weapon1`, `Weapon2`, `Weapon3`, `Weapon4`, `Weapon5`, `Weapon6`, `Weapon7`, `Weapon8`, `Weapon9`, `Weapon10`, `Weapon11`, `Weapon12`, \ `Kills`, `Deaths`, `Hours`, `Minutes`, `KillingSpree`, `Skin`, `House`, `Biz`, `Admin`, `HP`, `Armour`, `Wanted`"); //------------------------------------------------------------------ format(rQuery, 4096, "%s `Warns`, `TeamID`, `TeamKills`, `TeamDeaths`, `TeamRank`, `Wanted`, `Car`,\ `Team`)", rQuery); //------------------------------------------------------------------ format(rQuery, 4096, "%s VALUES (0, '%s', '%s', '%s', '1', '%02d/%02d/%02d', '%02d/%02d/%02d', \ '0', '0', '25000', '100', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '217', '1', '0', '0', \ ' ', ' ', ' ', '0', '0', '0', '0', '0', '0', '0', \ '0', '0', '0', '0', '0', '0', '0', '0', '0', '00:00', '0', '00:00', '0', '00:00', \ '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', \ '0/0/0/0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0')", rQuery, GetName(playerid), rPassword, stringip, liDay, liMonth, liYear, liDay, liMonth, liYear); //------------------------------------------------------------------ mysql_tquery(DB_Connect, rQuery, "OnAccountCreated", "i", playerid); //------------------------------------------------------------------ format(sStr2, sizeof(sStr2), "{00FF00}Salut {FF0000}%s{00FF00}!\n", GetName(playerid)); strcat(sStr, sStr2, sizeof(sStr)); strcat(sStr, "{00FF00}Ai Fost Inregistrat la TeamBattleRomania\n", sizeof(sStr)); format(sStr2, sizeof(sStr2), "{00FF00}Tine minte! Cand te loghezi te poti inregistra co parola: {FF0000}%s{00FF00}!\n\n", rPassword); strcat(sStr, sStr2, sizeof(sStr)); strcat(sStr, "{FFFF00}Pentru mai multe informatii apasa pe butonul: {FF0000}Ajutor{FFFF00}.\n", sizeof(sStr)); //---------------------------------------------------------- return ShowPlayerDialog(playerid, DIALOG_AREGISTER, DIALOG_STYLE_MSGBOX, "Inregistrare Reusita!", sStr, "Inchide", "Ajutor"); } if(dialogid == DIALOG_LOGIN) { if(!response) Kick(playerid); eString[128] = EOS; new lPassword[25], Query[512]; //------------------------------------------------------------------ if(sscanf(inputtext, "s[25]", lPassword)) { format(eString, sizeof(eString), "{00FF00}Bun venit inapoi: {FF0000}%s{00FF00}!\n\ {FFFF00}Te rog inregistreaza-te pentru a continua!",GetName(playerid)); //-------------------------------------------------------------- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Logare", eString, "Logare", "Iesire"); } if(strlen(inputtext) < 3 || strlen(inputtext) > 24) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Logare", "{00FF00}Te rog,scrie-ti parola", "Logare", "Iesire"); //------------------------------------------------------------------ if(strfind(inputtext, "'", true) != -1) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Logare", "{00FF00}Trebuie sa-ti scrii parola pentru a continua!\n{FFFF00}Nu poti scrie vre-o parola cu vre-un simbol!", "Logare", "Iesire"); //------------------------------------------------------------------ else { mysql_real_escape_string(inputtext, lPassword, DB_Connect); //-------------------------------------------------------------- format(Query, sizeof(Query), "SELECT * FROM `Conturi` WHERE `Name` = '%s' AND `Password` = '%s'", GetName(playerid), lPassword); mysql_tquery(DB_Connect, Query, "LoadPlayerData", "is", playerid, GetName(playerid)); //-------------------------------------------------------------- } } return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } forward RandomMessagesTimer(); public RandomMessagesTimer() { SendClientMessageToAll(GREEN, RandomMessages[random(sizeof(RandomMessages))]); return 1; } function LoginAccount(playerid) { //-------------------------------------------------------------------------- PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID", DB_Connect); PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level", DB_Connect); PlayerInfo[playerid][pExp] = cache_get_field_content_int(0, "Exp", DB_Connect); PlayerInfo[playerid][pPP] = cache_get_field_content_int(0, "PremiumPoints", DB_Connect); PlayerInfo[playerid][pWeapon1] = cache_get_field_content_int(0, "Weapon1", DB_Connect); PlayerInfo[playerid][pWeapon2] = cache_get_field_content_int(0, "Weapon2", DB_Connect); PlayerInfo[playerid][pWeapon3] = cache_get_field_content_int(0, "Weapon3", DB_Connect); PlayerInfo[playerid][pWeapon4] = cache_get_field_content_int(0, "Weapon4", DB_Connect); PlayerInfo[playerid][pWeapon5] = cache_get_field_content_int(0, "Weapon5", DB_Connect); PlayerInfo[playerid][pWeapon6] = cache_get_field_content_int(0, "Weapon6", DB_Connect); PlayerInfo[playerid][pWeapon7] = cache_get_field_content_int(0, "Weapon7", DB_Connect); PlayerInfo[playerid][pWeapon8] = cache_get_field_content_int(0, "Weapon8", DB_Connect); PlayerInfo[playerid][pWeapon9] = cache_get_field_content_int(0, "Weapon9", DB_Connect); PlayerInfo[playerid][pWeapon10] = cache_get_field_content_int(0, "Weapon10", DB_Connect); PlayerInfo[playerid][pWeapon11] = cache_get_field_content_int(0, "Weapon11", DB_Connect); PlayerInfo[playerid][pWeapon12] = cache_get_field_content_int(0, "Weapon12", DB_Connect); PlayerInfo[playerid][pPass] = cache_get_field_content_int(0, "Password", DB_Connect); PlayerInfo[playerid][Kills] = cache_get_field_content_int(0, "Kills", DB_Connect); PlayerInfo[playerid][Deaths] = cache_get_field_content_int(0, "Deaths", DB_Connect); PlayerInfo[playerid][hours] = cache_get_field_content_int(0, "Hours", DB_Connect); PlayerInfo[playerid][mins] = cache_get_field_content_int(0, "Minutes", DB_Connect); PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin", DB_Connect); PlayerInfo[playerid][KillingSpree] = cache_get_field_content_int(0, "KillingSpree", DB_Connect); PlayerInfo[playerid][pCar] = cache_get_field_content_int(0, "Car", DB_Connect); PlayerInfo[playerid][pHouse] = cache_get_field_content_int(0, "House", DB_Connect); PlayerInfo[playerid][pBiz] = cache_get_field_content_int(0, "Business", DB_Connect); PlayerInfo[playerid][pCash] = cache_get_field_content_int(0, "Money", DB_Connect); PlayerInfo[playerid][House] = cache_get_field_content_int(0, "House", DB_Connect); TeamInfo[playerid][TeamKills] = cache_get_field_content_int(0, "TeamKills", DB_Connect); TeamInfo[playerid][TeamDeaths] = cache_get_field_content_int(0, "TeamDeaths", DB_Connect); TeamInfo[playerid][TeamID] = cache_get_field_content_int(0, "TeamID", DB_Connect); TeamInfo[playerid][TeamName] = cache_get_field_content_int(0, "TeamName", DB_Connect); PlayerInfo[playerid][pJailed] = cache_get_field_content_int(0, "Jailed", DB_Connect); PlayerInfo[playerid][pWarns] = cache_get_field_content_int(0, "Warns", DB_Connect); PlayerInfo[playerid][pWantedLevel] = cache_get_field_content_int(0, "Wanted", DB_Connect); PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0, "Skin", DB_Connect); PlayerInfo[playerid][pMuted] = cache_get_field_content_int(0, "Muted", DB_Connect); PlayerInfo[playerid][pMuteTime] = cache_get_field_content_int(0, "MuteTime", DB_Connect); PlayerInfo[playerid][pJailTime] = cache_get_field_content_int(0, "JailTime", DB_Connect); TeamInfo[playerid][TeamRank] = cache_get_field_content_int(0, "TeamRank", DB_Connect); PlayerInfo[playerid][pScore] = cache_get_field_content_int(0, "Score", DB_Connect); //-------------------------------------------------------------------------- ResetPlayerMoney(playerid); GivePlayerMoney(playerid, cache_get_field_content_int(0, "Money", DB_Connect)); SetPlayerScore(playerid, cache_get_field_content_int(0, "Score", DB_Connect)); SetPlayerWantedLevel(playerid, cache_get_field_content_int(0, "Wanted", DB_Connect)); SetPlayerSkin(playerid, cache_get_field_content_int(0, "Skin", DB_Connect)); //-------------------------------------------------------------------------- return 1; } function LoadPlayerData(playerid, q_acc[]) { new q_rows, q_fields; eQuery[0] = EOS; eString[0] = EOS; cache_get_data(q_rows, q_fields, DB_Connect); //-------------------------------------------------------------------------- if(!q_rows) { PlayerInfo[playerid][pFailLogin]++; //---------------------------------------------------------------------- if(PlayerInfo[playerid][pFailLogin] >= MaxWarnings) { format(eString, sizeof(eString), "*** {FF0000}%s(%d) {AFAFAF}a primit kick. Motiv: {FF0000}Autentificare nereusita!{AFAFAF} ***", GetName(playerid), playerid); SendClientMessageToAll(GREY, eString); //------------------------------------------------------------------ } else { format(eString, sizeof(eString), "{FF0000}Autentificare nereusita (%d/%d)!\n\n{FFFF00}Ai introdus parola gresita. Te rugam sa incerci din nou!", PlayerInfo[playerid][pFailLogin], MaxWarnings); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Autentificare {FF0000}Nereusita", eString, "Autentificare", "Iesire"); } } else if(q_rows) { format(eQuery, sizeof(eQuery), "SELECT * FROM `Accounts` WHERE `Name` = '%s'", GetName(playerid)); mysql_tquery(DB_Connect, eQuery, "LoginAccount", "i", playerid); } return 1; }