Weird YSI/Gamemode problem -
CrazyManiac - 24.07.2013
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:
Код:
----------
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] ===============================
Register & Login system:
Код:
#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;
}
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
Re: Weird YSI/Gamemode problem -
JimmyCh - 24.07.2013
Are you using the OnPlayerCommandText or ZCMD or..
As I understood from you, your loading stuff are loading normally but the commands won't work, is that correct?
EDIT: Are you spawning at the correct location, and do you have some mapped objects? So we can see if they are even loading? Is your login/register system a FS?
EDIT(2): Are ALL commands not working, and can you show us their codes please?
Re: Weird YSI/Gamemode problem -
CrazyManiac - 24.07.2013
I use OnPlayerCommandText. Yes, that is correct, loading stuff are loading normally but the commands won't work.
Im spawning at the correct location (the SetSpawnInfo location), and I dont have any mapped objects.
Login/register system is an include (it's part of the YSI include).
Re: Weird YSI/Gamemode problem -
PrinceKumar - 24.07.2013
show me your commands
Re: Weird YSI/Gamemode problem -
JimmyCh - 24.07.2013
Show us your commands please, might be a return 1/return 0 problem.
If it's return 1; put it to return 0 at the end.
Re: Weird YSI/Gamemode problem -
PrinceKumar - 24.07.2013
i think y_ini
Re: Weird YSI/Gamemode problem -
CrazyManiac - 24.07.2013
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/smallfirework", cmdtext, true, 10) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "[NOTE]: You cannot use firework inside a vehicle!");
if(Ramdan[playerid][0] == 1) return SendClientMessage(playerid, -1, "[NOTE]: Please wait before using firework again.");
GetPlayerPos(playerid, X, Y, Z);
Ramdan[playerid][1] = CreateObject(SwitchID(14393), X, Y, Z-1.0, 0.0, 0.0, 0.0);
Ramdan[playerid][2] = CreateObject(SwitchID(14469), X, Y, Z-2.5, 0.0, 0.0, 0.0);
SetTimerEx("UpRamdan", 5000, false, "%d", playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
Ramdan[playerid][0] = 1;
return 1;
}
if (strcmp("/bigfirework", cmdtext, true, 10) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "[NOTE]: You cannot use firework inside a vehicle!");
if(Star[playerid][0] == 1) return SendClientMessage(playerid, -1, "[NOTE]: Please wait before using firework again.");
GetPlayerPos(playerid, X, Y, Z);
Star[playerid][1] = CreateObject(SwitchID(14393), X, Y, Z-1.0, 0.0, 0.0, 0.0);
Star[playerid][2] = CreateObject(SwitchID(14469), X, Y, Z-2.5, 0.0, 0.0, 0.0);
SetTimerEx("UpStar1", 5000, false, "%d", playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
Star[playerid][0] = 1;
return 1;
}
if (strcmp("/i", cmdtext, true, 10) == 0)
{
new string[256], sendername[MAX_PLAYER_NAME];
new
breads,
beancans,
waterbottles,
milkpacks;
breads = PlayerInfo[playerid][pBreads];
beancans = PlayerInfo[playerid][pBeanCans];
waterbottles = PlayerInfo[playerid][pWaterBottles];
milkpacks = PlayerInfo[playerid][pMilkPacks];
format(string,sizeof(string), "{B3B3B3}%s{8A8A8A}'s Inventory\n\n{8A8A8A}Food & Drinks\n{0800A6}Breads: %d\n{0A00C4}Bean Cans: %d\n{0C00F2}Water Bottles: %d\n{665EFF}Milk Packs: %d",sendername,breads,beancans,waterbottles,milkpacks);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX , "{8A8A8A}Inventory", string, "Close", "");
return 1;
}
if (strcmp("/stats", cmdtext, true, 10) == 0)
{
new string[256], sendername[MAX_PLAYER_NAME];
new
admin,
kills,
deaths;
admin = PlayerInfo[playerid][pAdmin];
kills = PlayerInfo[playerid][pKills];
deaths = PlayerInfo[playerid][pDeaths];
format(string,sizeof(string), "{634494}%s's Statistics: {4400FF}Admin Level: %d, Kills: %d, Deaths: %d",sendername,admin,kills,deaths);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX , "{8A8A8A}Statistics", string, "Close", "");
return 1;
}
return 0;
}