Szerző Téma: Nincs adat mentés  (Megtekintve 433 alkalommal)

Nincs adat mentés
« Dátum: 2013. augusztus 15. - 17:02:41 »
0 Show voters
Hali!
megnyitottam az új szerverem, szerettem volna rá tenni egy regisztrációt hogy lehessen eredményszinteket elérni és menteni, de nem akar menteni.
házi szerveren a mentés tökéletesen mûködött... ötletek?
« Utoljára szerkesztve: 2013. augusztus 18. - 03:51:25 írta bencarter007 »

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Nincs adat mentés
« Válasz #1 Dátum: 2013. augusztus 15. - 18:24:40 »
0 Show voters
Másold be a mentést.

Nincs adat mentés
« Válasz #2 Dátum: 2013. augusztus 15. - 23:30:46 »
0 Show voters
mindent bemásolok, a régi módomból hoztam át, viszont nem értem ,hogy ha a házi szerveren ment, akkor a bérelt szerón miért nem...
 
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
//Credits to Y_Less, Dracoblue and Kush.
#include <a_samp>
#include <YSI\\y_ini>
#include zcmd
#include sscanf
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4
#define PATH \"/Users/%s.ini\"
#define COL_WHITE \"{FFFFFF}\"
#define COL_RED \"{F81414}\"
#define COL_GREEN \"{00FF22}\"
#define COL_LIGHTBLUE \"{00CED1}\"
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pXp,
    pLevel,
    pWarn
}
new PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int(\"Password\",PlayerInfo[playerid][pPass]);
    INI_Int(\"Cash\",PlayerInfo[playerid][pCash]);
    INI_Int(\"Admin\",PlayerInfo[playerid][pAdmin]);
    INI_Int(\"Xp\",PlayerInfo[playerid][pXp]);
    INI_Int(\"Level\",PlayerInfo[playerid][pLevel]);
    INI_Int(\"Warn\",PlayerInfo[playerid][pWarn]);
    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<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
main()
{
print(\"\\n----------------------------------\");
print(\" gamemode\");
print(\"----------------------------------\\n\");
}
public OnGameModeInit()
{
AddPlayerClass(127,-2145.0854,-73.6399,35.1719,334.9591,0,0,0,0,0,0); //
SendRconCommand(\"loadfs Map\");
SetWorldTime(0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), \"LoadUser_%s\", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,\"\"COL_WHITE\"Bejelentkezés\",\"\"COL_WHITE\"Type your password below to login.\",\"Login\",\"Quit\");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,\"\"COL_WHITE\"Registering...\",\"\"COL_WHITE\"Type your password below to register a new account.\",\"Register\",\"Quit\");
    }
    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][pAdmin]);
    INI_WriteInt(File,\"Xp\",PlayerInfo[playerid][pXp]);
    INI_WriteInt(File,\"Level\",PlayerInfo[playerid][pLevel]);
    INI_WriteInt(File,\"Warn\",PlayerInfo[playerid][pWarn]);
    INI_Close(File);
    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[])
{
    return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerLeaveCheckpoint(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 OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
    if(IsPlayerAdmin(playerid)) PlayerInfo[playerid][pAdmin] = 5;
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[])
{
    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\"Registering...\",\"\"COL_RED\"You have entered an invalid password.\\n\"COL_WHITE\"Type your password below to register a new account.\",\"Register\",\"Quit\");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,\"data\");
                INI_WriteInt(File,\"Password\",udb_hash(inputtext));
                INI_WriteInt(File,\"Cash\",2000);
                INI_WriteInt(File,\"Admin\",0);
                INI_WriteInt(File,\"XP\",0);
                INI_WriteInt(File,\"Level\",1);
                INI_WriteInt(File,\"Warn\",0);
                INI_Close(File);
                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                if(fexist(UserPath(playerid)))
             {
              INI_ParseFile(UserPath(playerid), \"LoadUser_%s\", .bExtra = true, .extra = playerid);
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,\"\"COL_WHITE\"Bejelentkezés\",\"\"COL_WHITE\"Type your password below to login.\",\"Login\",\"Quit\");
             }
             else
             {
              ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,\"\"COL_WHITE\"Registering...\",\"\"COL_WHITE\"Type your password below to register a new account.\",\"Register\",\"Quit\");
             }
   }
        }
        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);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
         ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,\"\"COL_WHITE\"\",\"\"COL_GREEN\"Sikeres bejelentkezés!\",\"Ok\",\"\");
         SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,\"\"COL_WHITE\"Login\",\"\"COL_RED\"You have entered an incorrect password.\\n\"COL_WHITE\"Type your password below to login.\",\"Login\",\"Quit\");
                }
                return 1;
            }
        }
    }
    return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
CMD:clearchat(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
SendClientMessageToAll(0xAA3333AA,\"\");
new name[MAX_PLAYER_NAME+1],
string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
printf(\" %s tisztította a chat-et!\",name);
SendClientMessageToAll(0xC4C4C4FF, string);
}
if (PlayerInfo[playerid][pAdmin] == 0)
{
   SendClientMessage(playerid,0xAA3333AA,\"Nincs hozzá jogosultságod!\");
}
return 1;
}
CMD:reloadmap(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendRconCommand(\"unloadfs map\");
SendRconCommand(\"loadfs map\");
print(\"Pálya újratöltve!\");
}
if (PlayerInfo[playerid][pAdmin] == 0)
{
   SendClientMessage(playerid,0xAA3333AA,\"Nincs hozzá jogosultságod!\");
}
return 1;
}

 

Dupla hozzászólás automatikusan összefûzve. ( 2013. augusztus 16. - 16:05:50 )

kell hozzá valamilyen plugin vagy valami más?
« Utoljára szerkesztve: 2013. augusztus 16. - 16:05:51 írta bencarter007 »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal