Hi guys,
I have 2 problems in my reg/log system..
When someone register after that spawn button dont show, so he need relog if he wants play on server
Second problem is that when someone logging in he need first press "Login" button then Spawn,
How i can fix it, thanks in advance to all :)
ps. Thanks to all in advance, you always fixing my problems with script, i love you guys <3 :)
I have 2 problems in my reg/log system..
When someone register after that spawn button dont show, so he need relog if he wants play on server
Second problem is that when someone logging in he need first press "Login" button then Spawn,
How i can fix it, thanks in advance to all :)
PHP Code:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 208.4068, 143.8843, 1003.0234);
return 1;
}
PHP Code:
public OnPlayerConnect(playerid)
{
uduelu[playerid] = 0;
dopustenduel[playerid] = 1;
//////REG/LOG
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""guenatroy"LOGIN",""COL_WHITE"Dobro dosli nazad na {0080C0}RB Arena DeathMatch\n{FFFFFF}Imate {0080C0}60 {FFFFFF}sekundi da upisete svoju lozinku ili ce te biti {F81414}kickovani.\n{FFFFFF}Uzivajte u igri i igrajte posteno.","Login","Izlaz");
TextDrawShowForPlayer(playerid, RegLog[0]); TextDrawShowForPlayer(playerid, RegLog[1]);
InterpolateCameraPos(playerid, 575.325988, -1244.656127, 25.845386, 735.324829, -1128.916870, 73.661872, 7777);
InterpolateCameraLookAt(playerid, 571.176696, -1247.412109, 26.278436, 733.528747, -1124.687866, 71.689620, 7777);
SetPlayerSkin(playerid, 29);
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""guenatroy"REGISTER",""COL_WHITE"Dobro dosli {0080C0}Novi igrac\n{FFFFFF}Ovo je {0080C0}RB Arena DeathMatch server.\n{FFFFFF}U prazno polje upisite vasu zeljenu lozinku te se registruje.\nImate {0080C0}60 {FFFFFF}sekundi da upisete svoju lozinku ili ce te biti {F81414}kickovani. ","Register","Izlaz");
}
/////////////
PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/9p0t9tp8zd/Las_Vegas_-_Let_it_ride_-_Charlie_Clouser.mp3");
InDM[playerid] = 0;
OcistiChat(playerid,16);
SCM(playerid, -1, ""BJELA"Ucitavanje podataka na nasem serveru.");
SCM(playerid, -1, ""BJELA"KAKP BISTE SE SPAWNOVALI PRITISNITE (SPAWN)");
return 1;
}
PHP Code:
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, ""guenatroy"REGISTRACIJA",""COL_RED"Unjeli ste pogresan password.\n"COL_WHITE"Unesite normalan password da se registrirate.","Register","Izlaz");
InterpolateCameraPos(playerid, 575.325988, -1244.656127, 25.845386, 735.324829, -1128.916870, 73.661872, 7777);
InterpolateCameraLookAt(playerid, 571.176696, -1247.412109, 26.278436, 733.528747, -1124.687866, 71.689620, 7777);
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,"Kill",0);
INI_WriteInt(File,"Death",0);
INI_WriteInt(File,"Skin", 24);
INI_Close(File);
SetSpawnInfo(playerid, 0, 24, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetPlayerPos(playerid, 1710.433715,-1669.379272,20.225049);
SetPlayerInterior(playerid, 18);
}
}
case DIALOG_LOGIN:
{
InterpolateCameraPos(playerid, 575.325988, -1244.656127, 25.845386, 735.324829, -1128.916870, 73.661872, 7777);
InterpolateCameraLookAt(playerid, 571.176696, -1247.412109, 26.278436, 733.528747, -1124.687866, 71.689620, 7777);
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]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetPlayerPos(playerid, 1710.433715,-1669.379272,20.225049);
SetPlayerInterior(playerid, 18);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""guenatroy"LOGIN",""COL_RED"Nazalost ste unjeli pogresan password.\n"COL_WHITE"Upisite sifru kako treba za pristup..","Login","Izlaz");
}
}
}
case dueldialog +1:
{
if(!response) return tijek = 0;
tipduela = listitem;
DuelOffered();
}
case dueldialog +2:
{
if(!response) return DuelDeclined();
SetPlayerPos(duel1, mjestoduel1);
SetPlayerFacingAngle(duel1, 4.5954);
SetCameraBehindPlayer(duel1);
SetPlayerPos(duel2, mjestoduel2);
SetPlayerFacingAngle(duel2, 188.0179);
SetCameraBehindPlayer(duel2);
SetPlayerHealth(duel2, 100);
SetPlayerHealth(duel1, 100);
SetPlayerArmour(duel2, 100);
SetPlayerArmour(duel1, 100);
tijek = 2;
SetPlayerInterior(duel1, 0);
SetPlayerInterior(duel2, 0);
new string[128];
format(string, sizeof(string), "{ff0000}[DUEL] {ffffff}Duel izmedju %s(%d) i %s(%d) je poceo. (Ulog: %d)", PlayerName(duel1), duel1, PlayerName(duel2), duel2, Ulog);
SendClientMessageToAll(-1, string);
TogglePlayerControllable(duel1, false);
TogglePlayerControllable(duel2, false);
uduelu[duel1] = 1;
uduelu[duel2] = 1;
GiveDuelWeapons(tipduela);
CD = 6;
CDTimer = SetTimer("CountDown", 1000, 1);
KillTimer(dueltajmer);
DUEL_TIMER = SetTimer("TIMEUP", 60000*3, 0);
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}