24.07.2013, 17:24
Hello all!
I have a weird problem. I don't know if it has anything to do with YSI or with the gamemode itself, but i'll explain it to ya! When I connect to my server, it shows me my register/login dialog. It works perfectly. After typing "Login", I get spawned (I used SetSpawnInfo and Spawn underneath the login dialog response). Now, all of this works fine. But here comes the problem. None of my commands works! I have about 4/5 commands, and whenever I try to use them, it says Unknown Command!
It is like the player is not connected to the script or something.
NOTE: Gamemode is NOT ''Unknown''.
NOTE: I tried using NativeChecker.
NOTE: I have plugins "scanff" and "nativechecker". The system loads them both successfully when started.
NOTE: My plugins are updated to the last version of them.
Here's some more information about the script:
server_log:
Register & Login system:
I really tried the best I could to fix this problem, but I see no solution.
Hopefully is there someone that is able to fix it
Thanks & Greets, CrazyManiac
I have a weird problem. I don't know if it has anything to do with YSI or with the gamemode itself, but i'll explain it to ya! When I connect to my server, it shows me my register/login dialog. It works perfectly. After typing "Login", I get spawned (I used SetSpawnInfo and Spawn underneath the login dialog response). Now, all of this works fine. But here comes the problem. None of my commands works! I have about 4/5 commands, and whenever I try to use them, it says Unknown Command!
It is like the player is not connected to the script or something. NOTE: Gamemode is NOT ''Unknown''.
NOTE: I tried using NativeChecker.
NOTE: I have plugins "scanff" and "nativechecker". The system loads them both successfully when started.
NOTE: My plugins are updated to the last version of them.
Here's some more information about the script:
server_log:
Код:
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3x, ©2005-2013 SA-MP Team [19:24:23] filterscripts = "" (string) [19:24:23] [19:24:23] Server Plugins [19:24:23] -------------- [19:24:23] Loading plugin: sscanf [19:24:23] [19:24:23] =============================== [19:24:23] sscanf plugin loaded. [19:24:23] © 2009 Alex "******" Cole [19:24:23] =============================== [19:24:23] Loaded. [19:24:23] Loading plugin: nativechecker [19:24:23] Loaded. [19:24:23] Loaded 2 plugins. [19:24:23] [19:24:23] Filterscripts [19:24:23] --------------- [19:24:23] Loaded 0 filterscripts. [19:24:23] [19:24:23] [19:24:23] [19:24:23] ======================================= [19:24:23] | | [19:24:23] | YSI version 3.09.0684 | [19:24:23] | By Alex "******" Cole | [19:24:23] | | [19:24:23] ======================================= [19:24:23] [19:24:23] [19:24:23] [19:24:23] ---------------------------------- [19:24:23] Survival Island - Made By CrazyManiac! [19:24:23] ---------------------------------- [19:24:23] Number of vehicle models: 0 [19:24:35] --- Server Shutting Down. (I shut the server down) [19:24:35] [19:24:35] =============================== [19:24:35] sscanf plugin unloaded. [19:24:35] ===============================
Код:
#define DIALOG_REGISTER 1 #define DIALOG_LOGIN 2 #define DIALOG_SUCCESS_1 3 #define DIALOG_SUCCESS_2 4
Код:
#define PATH "/Users/%s.ini"
Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pSkin,
pDeaths,
pBreads,
pBeanCans,
pWaterBottles,
pMilkPacks
}
Код:
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("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Skin",PlayerInfo[playerid][pSkin]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("Breads",PlayerInfo[playerid][pBreads]);
INI_Int("BeanCans",PlayerInfo[playerid][pBeanCans]);
INI_Int("WaterBottles",PlayerInfo[playerid][pWaterBottles]);
INI_Int("MilkPacks",PlayerInfo[playerid][pMilkPacks]);
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;
}
Код:
public OnPlayerConnect(playerid)
{
FadePlayerConnect(playerid);
pFadePlace[playerid]=1;
FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10); // Nothing > Red
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_PLYMOUTH"Login",""COL_AQUA"Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_PLYMOUTH"Register",""COL_AQUA"Type your password below to register a new account.","Register","Quit");
}
return 1;
}
Код:
public OnPlayerDisconnect(playerid, reason)
{
FadePlayerDisconnect(playerid);
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,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Breads",PlayerInfo[playerid][pBreads]);
INI_WriteInt(File,"BeanCans",PlayerInfo[playerid][pBeanCans]);
INI_WriteInt(File,"WaterBottles",PlayerInfo[playerid][pWaterBottles]);
INI_WriteInt(File,"MilkPacks",PlayerInfo[playerid][pMilkPacks]);
INI_Close(File);
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_PLYMOUTH"Register",""COL_DARKRED"You have entered an invalid password.\n"COL_AQUA"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",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Breads",0);
INI_WriteInt(File,"BeanCans",0);
INI_WriteInt(File,"WaterBottles",0);
INI_WriteInt(File,"MilkPacks",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_PLYMOUTH"Success!",""COL_GREEN"Great! You have successfully registered a new account.","Continue","");
}
}
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]);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_PLYMOUTH"Success!",""COL_GREEN"You have successfully logged in!","Continue","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_PLYMOUTH"Login",""COL_DARKRED"You have entered an incorrect password.\n"COL_AQUA"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}
Hopefully is there someone that is able to fix it

Thanks & Greets, CrazyManiac

