01.11.2012, 15:22
Hello Guys.
I just started with a brand new server. I made a Roleplay test, and it works fine.
The only problem is that if a player cancels the Roleplay test (and gets kicked), and relogs, he
Will spawn (so he didnt do the Roleplay test but he's still able to play). So i need a system which
Checks if he did the Roleplay test already. The roleplay test comes after a player registered.
I was thinking about something like this:
So i (probably) need a line at the end of the RP Tutorial that sets the player's RPTEST to 1, and when
A player spawns (not at connect, because he needs to log in first), the system checks if he did the RP test.
Anyone knows how to do this? I hope i explained it well.
Greetings, CrazyManiac
I just started with a brand new server. I made a Roleplay test, and it works fine.
The only problem is that if a player cancels the Roleplay test (and gets kicked), and relogs, he
Will spawn (so he didnt do the Roleplay test but he's still able to play). So i need a system which
Checks if he did the Roleplay test already. The roleplay test comes after a player registered.
I was thinking about something like this:
Код:
enum pInfo { pPass, pCash, pAdmin, pKills, pDeaths, pRPTEST }
Код:
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("Deaths",PlayerInfo[playerid][pDeaths]); INI_Int("RpTest",PlayerInfo[playerid][pRPTEST]); 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,"Kills",PlayerInfo[playerid][pKills]); INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); INI_WriteInt(File,"RpTest",PlayerInfo[playerid][pRPTEST]); INI_Close(File); return 1; }
Код:
case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""WIT"Register",""ROOD"You have entered an invalid password.\n"DONKER_ROOD"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,"Deaths",0); INI_WriteInt(File,"RpTest",0); INI_Close(File); SendClientMessage(playerid,0x7FFF7AFF,"Registration succeed!"); SetPlayerPos(playerid,2109.1763,1503.0453,32.2887); ShowPlayerDialog(playerid, DIALOG_ROLEPLAY, DIALOG_STYLE_MSGBOX, "Roleplay Test", "You will now proceed to the Roleplay Test.", "Ok", "Quit"); } }
A player spawns (not at connect, because he needs to log in first), the system checks if he did the RP test.
Anyone knows how to do this? I hope i explained it well.
Greetings, CrazyManiac