üdv forumozók!
az lenne a problémém hogy irtam egy kissebb modot amibe elkéne menteni a szintet az idõt meg ilyeneket de nem menti el ahogy kilépek olyan mintha fent sem lettem volna a serveren a regisztrálás utáni lelépést nézi és ennyi...
pls valaki gyors fussa át és mondja meg mi lehet a hiba
#include
#include
#include
#include
#include
#include
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_KOR 3
#define DIALOG_NEM 4
#define DM 5
#define PG 6
#define RK 7
#define SK 8
#define MG 9
#define RP 10
#define OOC 11
#define IC 12
#define PATH \"/FaceRPG/Users/%s.sav\"
#define COL_WHITE \"{FFFFFF}\"
#define COL_RED \"{F81414}\"
#define COL_GREEN \"{00FF22}\"
#define COL_LIGHTBLUE \"{00CED1}\"
#define RED 0xff0000AA
new Text:hat, Text:bank, Text:Ft, Text:Ftb[MAX_PLAYERS], Text:ehs, Text:szaz[MAX_PLAYERS], Text:per[MAX_PLAYERS], Text:szin[MAX_PLAYERS];
new ehseg[MAX_PLAYERS];
new elso[MAX_PLAYERS];
new check;
new Zone;
main(){}
enum pInfo
{
pPass,
Cash,
Admin,
Level,
Det,
Ugy,
Tes,
Uti,
Box,
Bus,
Ujs,
Kam,
Far,
Fun,
Epi,
Kuk,
Piz,
Fav,
Tar,
Aut,
Dro,
Feg,
Pro,
REN,
MEN,
YAK,
GRO,
AZT,
Kor,
Nem,
ido,
reg
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new pname[MAX_PLAYER_NAME];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
new INI:File = INI_Open(UserPath(playerid));
INI_Int(\"Password\",PlayerInfo[playerid][pPass]);
INI_Int(\"Cash\",PlayerInfo[playerid][Cash]);
INI_Int(\"Admin\",PlayerInfo[playerid][Admin]);
INI_Int(\"Level\",PlayerInfo[playerid][Level]);
INI_Int(\"Detektiv\",PlayerInfo[playerid][Det]);
INI_Int(\"Ugyved\",PlayerInfo[playerid][ugy]);
INI_Int(\"Testor\",PlayerInfo[playerid][Tes]);
INI_Int(\"Uttiszt\",PlayerInfo[playerid][uti]);
INI_Int(\"Boxos\",PlayerInfo[playerid][box]);
INI_Int(\"Buszos\",PlayerInfo[playerid][bus]);
INI_Int(\"Ujságkih\",PlayerInfo[playerid][ujs]);
INI_Int(\"Kamionos\",PlayerInfo[playerid][Kam]);
INI_Int(\"Farmer\",PlayerInfo[playerid][Far]);
INI_Int(\"Funyiros\",PlayerInfo[playerid][Fun]);
INI_Int(\"Epitesz\",PlayerInfo[playerid][Epi]);
INI_Int(\"Kukas\",PlayerInfo[playerid][Kuk]);
INI_Int(\"Pizzafut\",PlayerInfo[playerid][Piz]);
INI_Int(\"Favago\",PlayerInfo[playerid][Fav]);
INI_Int(\"Targoncas\",PlayerInfo[playerid][Tar]);
INI_Int(\"Autotolv\",PlayerInfo[playerid][Aut]);
INI_Int(\"Drogdiler\",PlayerInfo[playerid][Dro]);
INI_Int(\"Fegyverker\",PlayerInfo[playerid][Feg]);
INI_Int(\"Prosti\",PlayerInfo[playerid][Pro]);
INI_Int(\"Rendor\",PlayerInfo[playerid][REN]);
INI_Int(\"Mentos\",PlayerInfo[playerid][MEN]);
INI_Int(\"Yakuza\",PlayerInfo[playerid][YAK]);
INI_Int(\"Groove\",PlayerInfo[playerid][GRO]);
INI_Int(\"Aztek\",PlayerInfo[playerid][AZT]);
INI_Int(\"Kor\",PlayerInfo[playerid][Kor]);
INI_Int(\"Nem\",PlayerInfo[playerid][Nem]);
INI_Int(\"ido\",PlayerInfo[playerid][ido]);
INI_Int(\"reg\",PlayerInfo[playerid][reg]);
INI_Close(File);
return 1;
}
public OnPlayerConnect(playerid)
{
if(!IsRolePlayName(playerid))
{
SendClientMessage(playerid,0xFF0000FF, \"Nem RPG-s a neved! Igy Vezetéknév_Keresztnév! \");
Kick(playerid);
}
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), \"LoadUser_%s\", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,\"Bejelentkezés\",\"Írd be a jelszód a belépéshez\",\"Belép\",\"Bezár\");
}else{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,\"\"COL_WHITE\"Regisztráció...\",\"\"COL_WHITE\"Ird be a jelszavad az új acountért.\",\"Register\",\"Quit\");
}
hat = TextDrawCreate(630.000000, 77.000000, \".\");
TextDrawBackgroundColor(hat, 255);
TextDrawFont(hat, 1);
TextDrawLetterSize(hat, 0.000000, 6.000000);
TextDrawColor(hat, -1);
TextDrawSetOutline(hat, 0);
TextDrawSetProportional(hat, 1);
TextDrawSetShadow(hat, 1);
TextDrawUseBox(hat, 1);
TextDrawBoxColor(hat, 255);
TextDrawTextSize(hat, 490.000000, 38.000000);
TextDrawSetSelectable(hat, 0);
bank = TextDrawCreate(537.000000, 98.000000, \"Bank:\");
TextDrawBackgroundColor(bank, 65535);
TextDrawFont(bank, 1);
TextDrawLetterSize(bank, 0.500000, 1.000000);
TextDrawColor(bank, 255);
TextDrawSetOutline(bank, 1);
Ft = TextDrawCreate(509.000000, 109.000000, \"00000000FT\");
TextDrawBackgroundColor(Ft, 65535);
TextDrawFont(Ft, 1);
TextDrawLetterSize(Ft, 0.500000, 1.000000);
TextDrawColor(Ft, 255);
TextDrawSetOutline(Ft, 1);
Ftb[playerid] = TextDrawCreate(496.000000, 74.000000, \"00000000FT\");
TextDrawBackgroundColor(Ftb[playerid], 65535);
TextDrawFont(Ftb[playerid], 3);
TextDrawLetterSize(Ftb[playerid], 0.620000, 2.700000);
TextDrawColor(Ftb[playerid], 255);
TextDrawSetOutline(Ftb[playerid], 1);
TextDrawSetProportional(Ftb[playerid], 1);
TextDrawSetSelectable(Ftb[playerid], 0);
ehs = TextDrawCreate(514.000000, 120.000000, \"Ehseg:\");
TextDrawBackgroundColor(ehs, 255);
TextDrawFont(ehs, 1);
TextDrawLetterSize(ehs, 0.500000, 1.000000);
TextDrawColor(ehs, -1);
szaz[playerid] = TextDrawCreate(567.000000, 120.000000, \"100%\");
TextDrawBackgroundColor(szaz[playerid], 255);
TextDrawFont(szaz[playerid], 1);
TextDrawLetterSize(szaz[playerid], 0.500000, 1.000000);
TextDrawColor(szaz[playerid], -16776961);
per[playerid] = TextDrawCreate(567.000000, 100.000000, \"0 Perc Van Hátrtra\");
TextDrawBackgroundColor(per[playerid], 255);
TextDrawFont(per[playerid], 1);
TextDrawLetterSize(per[playerid], 0.500000, 1.000000);
TextDrawColor(per[playerid], -16776961);
szin[playerid] = TextDrawCreate(567.000000, 150.000000, \"0\");
TextDrawBackgroundColor(szin[playerid], 255);
TextDrawFont(szin[playerid], 1);
TextDrawLetterSize(szin[playerid], 0.500000, 1.000000);
TextDrawColor(szin[playerid], -16776961);
return 1;
}
public OnGameModeInit()
{
SetGameModeText(\"[HUN]FaceRPG\");
UsePlayerPedAnims();
ShowNameTags(false);
ShowPlayerMarkers(false);
Create3DTextLabel(\"Városháza\", RED, 1481.0342,-1772.3125,18.7958, 40.0, 0, 0);
Create3DTextLabel(\"Utca\", RED, 13.2425,-2.6973,3.1578, 40.0, 0, 0);
Zone = GangZoneCreate(-3000, -3000, 3000, 3000);
CreateDynamicObject(15034, 11.6, -3.2, 3.9, 0, 0, 2);
CreateDynamicObject(1998, 15.8, -10.1, 2.2, 0, 0, 92);
CreateDynamicObject(1714, 15.3, -9.2, 2.2, 0, 0, 270);
CreateDynamicObject(2164, 19.9, -8.3, 2.2, 0, 0, 270);
CreateDynamicObject(2001, 19.5, -10, 2.2, 0, 0, 0);
CreateDynamicObject(1998, 9.7, -8.6, 2.2, 0, 0, 272);
CreateDynamicObject(2164, 4.4, -10.4, 2.2, 0, 0, 92);
CreateDynamicObject(2001, 4.8, -8.7, 2.2, 0, 0, 0);
CreateDynamicObject(1714, 10.1, -9.5, 2.2, 0, 0, 92);
CreateDynamicObject(2200, 7.3, 0.9, 2.2, 0, 0, 92);
CreateDynamicObject(2610, 7.2, 3.1, 3, 0, 0, 96);
CreateDynamicObject(2610, 7.4, 0, 3, 0, 0, 93.998);
CreateDynamicObject(2184, 10.4, 1, 2.2, 0, 0, 88);
CreateDynamicObject(2190, 10.2, 2.9, 3, 0, 0, 286);
CreateDynamicObject(2202, 8.1, -1.6, 2.2, 0, 0, 92);
CreateDynamicObject(1714, 10.09961, -9.5, 2.2, 0, 0, 92);
CreateDynamicObject(1714, 9.1, 2.2, 2.2, 0, 0, 92);
CreateDynamicObject(2249, 10, 1, 3.6, 0, 0, 0);
CreateDynamicObject(2571, 12.4, 2.4, 2.2, 0, 0, 270);
CreateDynamicObject(1504, 13.6, -1.9, 2.2, 0, 0, 274);
CreateDynamicObject(1502, 13, -7.8, 2.2, 0, 0, 180);
CreateDynamicObject(1502, 9.69922, -5.19922, 2.2, 0, 0, 92);
CreateDynamicObject(2521, 5.9, -2.7, 2.2, 0, 0, 4);
CreateDynamicObject(2521, 3.89941, -2.89941, 2.2, 0, 0, 3.999);
CreateDynamicObject(2521, 4.89941, -2.7998, 2.2, 0, 0, 3.999);
CreateDynamicObject(2524, 7.4, -6.8, 2.2, 0, 0, 184);
CreateDynamicObject(2524, 6.1, -6.8, 2.2, 0, 0, 181.999);
CreateDynamicObject(2524, 8.9, -6.8, 2.2, 0, 0, 183.999);
return 1;
}
public OnPlayerSpawn(playerid)
{
GangZoneShowForPlayer(playerid, Zone, 0x000000FF);
GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
ehseg[playerid] = 100;
SetTimerEx(\"CheckMoney\", 2000, true, \"i\", playerid);
SetTimerEx(\"ehse\", 15000, true, \"i\", playerid);
SetTimerEx(\"szint\", 200, true, \"i\", playerid);
TextDrawShowForPlayer(playerid, Ft);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
TextDrawShowForPlayer(playerid, hat);
TextDrawShowForPlayer(playerid, bank);
TextDrawShowForPlayer(playerid, ehs);
TextDrawShowForPlayer(playerid, szaz[playerid]);
TextDrawShowForPlayer(playerid, szin[playerid]);
if(PlayerInfo[playerid][reg]==0){
SetPlayerSkin(playerid,26);
SetPlayerInterior(playerid,10);
elso[playerid] = 1;
GivePlayerMoney(playerid, 250000);
SetPlayerPos(playerid,13.2425,-2.6973,3.1578);
ShowPlayerDialog(playerid, DIALOG_KOR, DIALOG_STYLE_LIST, \"Korod?\", \"14\\n15\\n16\\n17\\n18\\n19\\n20\", \"Választ\", \"Kilép\");
return 1;
}
else
{
new file[128];
new Float:x, Float:y, Float:z, Int, skin;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), \"FaceRPG/Pos/%s.pos\", pname);
x = dini_Float(file, \"posX\");
y = dini_Float(file, \"posY\");
z = dini_Float(file, \"posZ\");
Int = dini_Int(file, \"Int\");
skin = dini_Int(file, \"skin\");
SetPlayerInterior(playerid, Int);
SetPlayerSkin(playerid, skin);
SetPlayerPos(playerid, x, y, z);
}
return 1;
}
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
KillTimer(check);
return 1;
}
CMD:setmoney(playerid, params[]){
new id, penz;
if(sscanf(params, \"dd\", id, penz)) return SendClientMessage(playerid, -1, \"Használat: /setmoney [playerid] [szint]\");
GivePlayerMoney(id, penz);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, \"\"COL_WHITE\"Regisztráció...\",\"\"COL_RED\"Rossz jelszót adtál meg.\\n\"COL_WHITE\"Ird be a jelszavad az új acountért.\",\"Register\",\"Quit\");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,\"data\");
INI_WriteInt(File,\"Password\",udb_hash(inputtext));
INI_WriteInt(File,\"Cash\",0);
INI_WriteInt(File,\"Admin\",0);
INI_WriteInt(File,\"Level\",0);
INI_WriteInt(File,\"Detektiv\",0);
INI_WriteInt(File,\"Ugyved\",0);
INI_WriteInt(File,\"Testor\",0);
INI_WriteInt(File,\"Uttiszt\",0);
INI_WriteInt(File,\"Boxos\",0);
INI_WriteInt(File,\"Buszos\",0);
INI_WriteInt(File,\"Ujságkih\",0);
INI_WriteInt(File,\"Kamionos\",0);
INI_WriteInt(File,\"Farmer\",0);
INI_WriteInt(File,\"Funyiros\",0);
INI_WriteInt(File,\"Epitesz\",0);
INI_WriteInt(File,\"Kukas\",0);
INI_WriteInt(File,\"Pizzafut\",0);
INI_WriteInt(File,\"Favago\",0);
INI_WriteInt(File,\"Targoncas\",0);
INI_WriteInt(File,\"Autotolv\",0);
INI_WriteInt(File,\"Drogdiler\",0);
INI_WriteInt(File,\"Fegyverker\",0);
INI_WriteInt(File,\"Prosti\",0);
INI_WriteInt(File,\"Rendor\",0);
INI_WriteInt(File,\"Mentos\",0);
INI_WriteInt(File,\"Yakuza\",0);
INI_WriteInt(File,\"Groove\",0);
INI_WriteInt(File,\"Aztek\",0);
INI_WriteInt(File,\"Kor\",0);
INI_WriteInt(File,\"Nem\",0);
INI_WriteInt(File,\"ido\",0);
INI_WriteInt(File,\"reg\",0);
INI_Close(File);
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), \"LoadUser_%s\", .bExtra = true, .extra = playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,\"Bejelentkezés\",\"Helytelen jelszó.\\nÍrd be a jelszód a belépéshez.\",\"Belép\",\"Bezár\");
}
return 1;
}
}
}
if(dialogid == DIALOG_KOR)
{
switch(listitem)
{
case 0:{PlayerInfo[playerid][Kor] = 14;ShowPlayerDialog(playerid, DIALOG_NEM, DIALOG_STYLE_LIST, \"Nemed\", \"Férfi\\nNõ\", \"Választ\", \"Kilép\");}
case 1:{PlayerInfo[playerid][Kor] = 15;ShowPlayerDialog(playerid, DIALOG_NEM, DIALOG_STYLE_LIST, \"Nemed\", \"Férfi\\nNõ\", \"Választ\", \"Kilép\");}
case 2:{PlayerInfo[playerid][Kor] = 16;ShowPlayerDialog(playerid, DIALOG_NEM, DIALOG_STYLE_LIST, \"Nemed\", \"Férfi\\nNõ\", \"Választ\", \"Kilép\");}
case 3:{PlayerInfo[playerid][Kor] = 17;ShowPlayerDialog(playerid, DIALOG_NEM, DIALOG_STYLE_LIST, \"Nemed\", \"Férfi\\nNõ\", \"Választ\", \"Kilép\");}
case 4:{PlayerInfo[playerid][Kor] = 18;ShowPlayerDialog(playerid, DIALOG_NEM, DIALOG_STYLE_LIST, \"Nemed\", \"Férfi\\nNõ\", \"Választ\", \"Kilép\");}
case 5:{PlayerInfo[playerid][Kor] = 19;ShowPlayerDialog(playerid, DIALOG_NEM, DIALOG_STYLE_LIST, \"Nemed\", \"Férfi\\nNõ\", \"Választ\", \"Kilép\");}
case 6:{PlayerInfo[playerid][Kor] = 20;ShowPlayerDialog(playerid, DIALOG_NEM, DIALOG_STYLE_LIST, \"Nemed\", \"Férfi\\nNõ\", \"Választ\", \"Kilép\");}
}
}
if(dialogid == DIALOG_NEM)
{
switch(listitem)
{
case 0:{PlayerInfo[playerid][Nem] = 1;ShowPlayerDialog(playerid, DM, DIALOG_STYLE_LIST, \"Mi a DM?\", \"Ok nélküli ölés\\nKocsival elültés ugy hogy meghal\\nHalál utáni bosszú\", \"Választ\", \"Kilép\");}
case 1:{PlayerInfo[playerid][Nem] = 2;ShowPlayerDialog(playerid, DM, DIALOG_STYLE_LIST, \"Mi a DM?\", \"Ok nélküli ölés\\nKocsival elültés ugy hogy meghal\\nHalál utáni bosszú\", \"Választ\", \"Kilép\");}
}
}
if(dialogid == DM)
{
switch(listitem)
{
case 0:ShowPlayerDialog(playerid, PG, DIALOG_STYLE_LIST, \"Mi a PG(Power Gaming)?\", \"Folytonos öldöklés!\\nMásik player folytonos piszkálása!\\nOlyan dolog ami a való életbe nem lehetne/mernéd megtenni!\", \"Választ\", \"Kilép\");
case 1:Kick(playerid);
case 2:Kick(playerid);
}
}
if(dialogid == PG)
{
switch(listitem)
{
case 0:Kick(playerid);
case 1:Kick(playerid);
case 2:ShowPlayerDialog(playerid, RK, DIALOG_STYLE_LIST, \"Mi a RK(Revenge Kill)?\", \"Spawn helyen ölés!\\nHalál utáni bosszú!\\nOk nélküli ölés\", \"Választ\", \"Kilép\");
}
}
if(dialogid == RK)
{
switch(listitem)
{
case 0:Kick(playerid);
case 1:ShowPlayerDialog(playerid, SK, DIALOG_STYLE_LIST, \"Mi a SK(Spawn Kill)?\", \"Folytonos öldöklés!\\nKocsival elültés ugy hogy meghal\\nEgy játékost megölni a kezdõhelyen!\", \"Választ\", \"Kilép\");
case 2:Kick(playerid);
}
}
if(dialogid == SK)
{
switch(listitem)
{
case 0:Kick(playerid);
case 1:Kick(playerid);
case 2:ShowPlayerDialog(playerid, MG, DIALOG_STYLE_LIST, \"Mi a MG(Meta Gaming)?\", \"Szerepen kivüli adatok felhasználása játékban!\\nEgy játékost megölni szolgálat közben!\\nMásik player folytonos piszkálása!\", \"Választ\", \"Kilép\");
}
}
if(dialogid == MG)
{
switch(listitem)
{
case 0:ShowPlayerDialog(playerid, RP, DIALOG_STYLE_LIST, \"Mi az RP szó jelentése?\", \"Role Play\\nRevenge Play\\nRetardált Playerek\", \"Választ\", \"Kilép\");
case 1:Kick(playerid);
case 2:Kick(playerid);
}
}
if(dialogid == RP)
{
switch(listitem)
{
case 0:ShowPlayerDialog(playerid, OOC, DIALOG_STYLE_LIST, \"Mi az OOC?\", \"Out Of Chat\\nOn Game Chat\\nOut Of Caracter\", \"Választ\", \"Kilép\");
case 1:Kick(playerid);
case 2:Kick(playerid);
}
}
if(dialogid == OOC)
{
switch(listitem)
{
case 0:Kick(playerid);
case 1:Kick(playerid);
case 2:ShowPlayerDialog(playerid, IC, DIALOG_STYLE_LIST, \"Mi az IC?\", \"Ivett Cicije...\\nIn caracter chat\\nIn chat\", \"Választ\", \"Kilép\");
}
}
if(dialogid == IC)
{
switch(listitem)
{
case 0:Kick(playerid);
case 2:Kick(playerid);
case 1:{
PlayerInfo[playerid][reg] = 1;
GameTextForPlayer(playerid,\"~r~Készen vagy menny és éld az életed!\",5000,5);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,\"data\");
INI_WriteInt(File,\"Cash\",GetPlayerMoney(playerid));
INI_WriteInt(File,\"Admin\",PlayerInfo[playerid][Admin]);
INI_WriteInt(File,\"Level\",PlayerInfo[playerid][Level]);
INI_WriteInt(File,\"Detektiv\",PlayerInfo[playerid][Det]);
INI_WriteInt(File,\"Ugyved\",PlayerInfo[playerid][ugy]);
INI_WriteInt(File,\"Testor\",PlayerInfo[playerid][Tes]);
INI_WriteInt(File,\"Uttiszt\",PlayerInfo[playerid][uti]);
INI_WriteInt(File,\"Boxos\",PlayerInfo[playerid][box]);
INI_WriteInt(File,\"Buszos\",PlayerInfo[playerid][bus]);
INI_WriteInt(File,\"Ujságkih\",PlayerInfo[playerid][ujs]);
INI_WriteInt(File,\"Kamionos\",PlayerInfo[playerid][Kam]);
INI_WriteInt(File,\"Farmer\",PlayerInfo[playerid][Far]);
INI_WriteInt(File,\"Funyiros\",PlayerInfo[playerid][Fun]);
INI_WriteInt(File,\"Epitesz\",PlayerInfo[playerid][Epi]);
INI_WriteInt(File,\"Kukas\",PlayerInfo[playerid][Kuk]);
INI_WriteInt(File,\"Pizzafut\",PlayerInfo[playerid][Piz]);
INI_WriteInt(File,\"Favago\",PlayerInfo[playerid][Fav]);
INI_WriteInt(File,\"Targoncas\",PlayerInfo[playerid][Tar]);
INI_WriteInt(File,\"Autotolv\",PlayerInfo[playerid][Aut]);
INI_WriteInt(File,\"Drogdiler\",PlayerInfo[playerid][Dro]);
INI_WriteInt(File,\"Fegyverker\",PlayerInfo[playerid][Feg]);
INI_WriteInt(File,\"Prosti\",PlayerInfo[playerid][Pro]);
INI_WriteInt(File,\"Rendor\",PlayerInfo[playerid][REN]);
INI_WriteInt(File,\"Mentos\",PlayerInfo[playerid][MEN]);
INI_WriteInt(File,\"Yakuza\",PlayerInfo[playerid][YAK]);
INI_WriteInt(File,\"Groove\",PlayerInfo[playerid][GRO]);
INI_WriteInt(File,\"Aztek\",PlayerInfo[playerid][AZT]);
INI_WriteInt(File,\"Kor\",PlayerInfo[playerid][Kor]);
INI_WriteInt(File,\"Nem\",PlayerInfo[playerid][Nem]);
INI_WriteInt(File,\"ido\",PlayerInfo[playerid][ido]);
INI_WriteInt(File,\"reg\",PlayerInfo[playerid][reg]);
INI_Close(File);
}
}
}
return 1;
}
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n {
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
stock IsRolePlayName(playerid, bool:alphaonly = true)
{
new trpn[MAX_PLAYER_NAME];
if(GetPlayerName(playerid,trpn,sizeof(trpn))){
new strd = strfind(trpn, \"_\", false);
if(strfind(trpn,\"_\",false,strd+1) == -1){
if(strd > 0){
if(trpn[strd-1] && trpn[strd+1]){
if(alphaonly){
for(new a = 0, l = strlen (trpn); a < l; a++){
switch(trpn[a])
{
case \'0\' .. \'9\': return 0;
case \'a\' .. \'z\': continue;
case \'A\' .. \'Z\': continue;
case \'_\': continue; // easier than specifying every invalid char
default: return 0;
}}}
return 1;
}}}}
return 0;
}
CMD:enter(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid,1,1481.0342,-1772.3125,18.7958))
{
GameTextForPlayer(playerid, \"~w~Polgármesteri\", 5000, 1);
SetPlayerInterior(playerid, 10);
SetPlayerPos(playerid,13.2425,-2.6973,3.1578);
}else SendClientMessage(playerid,0xFF0000FF, \"Nem vagy bejárat közelében!\");
return 1;
}
CMD:exit(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid,1,13.2425,-2.6973,3.1578))
{
GameTextForPlayer(playerid, \"~w~Utca\", 5000, 1);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,1481.0342,-1772.3125,18.7958);
}else SendClientMessage(playerid,0xFF0000FF, \"Nem vagy kijárat közelében!\");
return 1;
}
CMD:me(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, 0xEE0000AA, \"Használat.: /me [cselekvés]\");
new
string[128],
pName[50 char]
;
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), \"* %s %s\", pName, params);
return SendClientMessageToAll(0xd52cdbAA, string);
}
CMD:do(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, 0xEE0000AA, \"Használat.: /do [történés]\");
new string[128];
format(string, sizeof(string), \"** %s\", params);
return SendClientMessageToAll(0xff00ffAA, string);
}
CMD:b(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, 0xEE0000AA, \"Használat.: /b [OOC szöveg]\");
new
string[128],
pName[100 char]
;
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), \"%s OOC: (( %s ))\", pName, params);
return SendClientMessageToAll(0xAFAFAFAA, string);
}
CMD:k(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, 0xEE0000AA, \"Használat.: /k [iC szöveg]\");
new string[128], pName[100];
new Float:x, Float:y, Float:z;
for(new i=0;i {
if(IsPlayerConnected(i)==1)
{
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(i, 17, x, y, z))
{
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), \"%s Ordítja: %s!!!!\", pName, params);
SendClientMessage(i, 0xFF0000AA,string);
}
}
}
return 1;
}
public OnPlayerText(playerid, text[])
{
new Float:x, Float:y, Float:z, str[200], pName[100];
for(new i=0;i {
if(IsPlayerConnected(i)==1)
{
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(i, 7, x, y, z))
{
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizeof(str), \"%s mondja: %s \", pName, text);
SendClientMessage(i, 0xFFFFFFAA,str);
}
}
}
return 0;
}
forward szint(playerid);
public szint(playerid)
{
new string[128];
PlayerInfo[playerid][ido]--;
format(string, sizeof(string), \"~r~%iPerc Van Vissza\", PlayerInfo[playerid][ido]);
TextDrawSetString(per[playerid], string);
TextDrawShowForPlayer(playerid, per[playerid]);
if(elso[playerid] == 1 && PlayerInfo[playerid][ido]<=0)
{
PlayerInfo[playerid][ido] = 120;
elso[playerid] = 0;
}
if(PlayerInfo[playerid][Level]==0 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 120;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==1 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 120;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==2 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 120;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==3 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 120;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==4 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 120;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==5 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 240;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==6 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 240;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==7 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 240;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==8 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 240;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==9 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 240;
PlayerInfo[playerid][Level]++;
format(string, sizeof(string), \"~r~%i\", PlayerInfo[playerid][Level]);
TextDrawSetString(szin[playerid], string);
TextDrawShowForPlayer(playerid, szin[playerid]);
}
if(PlayerInfo[playerid][Level]==10 && PlayerInfo[playerid][ido]<1)
{
PlayerInfo[playerid][ido] = 240;
}
}
forward ehse(playerid);
public ehse(playerid)
{
new string[128];
ehseg[playerid]--;
format(string, sizeof(string), \"~r~%i%\", ehseg[playerid]);
TextDrawSetString(szaz[playerid], string);
TextDrawShowForPlayer(playerid, szaz[playerid]);
if(ehseg[playerid] == 50)
{
SendClientMessage(playerid, 0xFFFFFFAA,\"Kezdessz éhes lenni menny egyél!\");
}
if(ehseg[playerid] == 10)
{
SendClientMessage(playerid, 0xFFFFFFAA,\"Gyorsan meny el enni különben éhen halsz!\");
}
if(ehseg[playerid] == 0)
{
SendClientMessage(playerid, 0xFFFFFFAA,\"Éhen haltál!\");
SetPlayerHealth(playerid,0);
}
}
forward CheckMoney(playerid);
public CheckMoney(playerid)
{
new string[128];
if(GetPlayerMoney(playerid) < 10)
{
format(string, sizeof(string), \"0000000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Ftb[playerid], string);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
}
if(10 <= GetPlayerMoney(playerid) < 100)
{
format(string, sizeof(string), \"000000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Ftb[playerid], string);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
}
if(100 <= GetPlayerMoney(playerid) < 1000)
{
format(string, sizeof(string), \"00000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Ftb[playerid], string);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
}
if(1000 <= GetPlayerMoney(playerid) < 10000)
{
format(string, sizeof(string), \"0000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Ftb[playerid], string);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
}
if(10000 <= GetPlayerMoney(playerid) < 100000)
{
format(string, sizeof(string), \"000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Ftb[playerid], string);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
}
if(100000 <= GetPlayerMoney(playerid) < 1000000)
{
format(string, sizeof(string), \"00%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Ftb[playerid], string);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
}
if(1000000 <= GetPlayerMoney(playerid) < 10000000)
{
format(string, sizeof(string), \"0%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Ftb[playerid], string);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
}
if(10000000 <= GetPlayerMoney(playerid) < 999999999)
{
format(string, sizeof(string), \"%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Ftb[playerid], string);
TextDrawShowForPlayer(playerid, Ftb[playerid]);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,\"data\");
INI_WriteInt(File,\"Cash\",GetPlayerMoney(playerid));
INI_WriteInt(File,\"Admin\",PlayerInfo[playerid][Admin]);
INI_WriteInt(File,\"Level\",PlayerInfo[playerid][Level]);
INI_WriteInt(File,\"Detektiv\",PlayerInfo[playerid][Det]);
INI_WriteInt(File,\"Ugyved\",PlayerInfo[playerid][ugy]);
INI_WriteInt(File,\"Testor\",PlayerInfo[playerid][Tes]);
INI_WriteInt(File,\"Uttiszt\",PlayerInfo[playerid][uti]);
INI_WriteInt(File,\"Boxos\",PlayerInfo[playerid][box]);
INI_WriteInt(File,\"Buszos\",PlayerInfo[playerid][bus]);
INI_WriteInt(File,\"Ujságkih\",PlayerInfo[playerid][ujs]);
INI_WriteInt(File,\"Kamionos\",PlayerInfo[playerid][Kam]);
INI_WriteInt(File,\"Farmer\",PlayerInfo[playerid][Far]);
INI_WriteInt(File,\"Funyiros\",PlayerInfo[playerid][Fun]);
INI_WriteInt(File,\"Epitesz\",PlayerInfo[playerid][Epi]);
INI_WriteInt(File,\"Kukas\",PlayerInfo[playerid][Kuk]);
INI_WriteInt(File,\"Pizzafut\",PlayerInfo[playerid][Piz]);
INI_WriteInt(File,\"Favago\",PlayerInfo[playerid][Fav]);
INI_WriteInt(File,\"Targoncas\",PlayerInfo[playerid][Tar]);
INI_WriteInt(File,\"Autotolv\",PlayerInfo[playerid][Aut]);
INI_WriteInt(File,\"Drogdiler\",PlayerInfo[playerid][Dro]);
INI_WriteInt(File,\"Fegyverker\",PlayerInfo[playerid][Feg]);
INI_WriteInt(File,\"Prosti\",PlayerInfo[playerid][Pro]);
INI_WriteInt(File,\"Rendor\",PlayerInfo[playerid][REN]);
INI_WriteInt(File,\"Mentos\",PlayerInfo[playerid][MEN]);
INI_WriteInt(File,\"Yakuza\",PlayerInfo[playerid][YAK]);
INI_WriteInt(File,\"Groove\",PlayerInfo[playerid][GRO]);
INI_WriteInt(File,\"Aztek\",PlayerInfo[playerid][AZT]);
INI_WriteInt(File,\"Kor\",PlayerInfo[playerid][Kor]);
INI_WriteInt(File,\"Nem\",PlayerInfo[playerid][Nem]);
INI_WriteInt(File,\"ido\",PlayerInfo[playerid][ido]);
INI_WriteInt(File,\"reg\",PlayerInfo[playerid][reg]);
INI_Close(File);
new file[128];
new Float:x, Float:y, Float:z, Int, skin;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), \"FaceRPG/Pos/%s.pos\", pname);
if(!dini_Exists(file))
dini_Create(file);
Int = GetPlayerInterior(playerid);
skin = GetPlayerSkin(playerid);
GetPlayerPos(playerid, x, y, z);
dini_FloatSet(file, \"posX\", x);
dini_FloatSet(file, \"posY\", y);
dini_FloatSet(file, \"posZ\", z);
dini_IntSet(file, \"Int\", Int);
dini_IntSet(file, \"skin\", skin);
return 1;
}