23.12.2010, 04:15
I have a server and am the only scripter and ama noob in this..Kinda
When someone connects to the server.It dislpays a register/login Dialog box.if someone clicks on Login..If password is entered it does its work.But if somehow someone clicks on cancel it closes the server connection..Saying "Server closed the connection"..This not only affects here.But on all the Dialog box i add in the server.If someone clicks on the right tab it closes the connection Please help..
This is my OnPlayerConnect Code
When someone connects to the server.It dislpays a register/login Dialog box.if someone clicks on Login..If password is entered it does its work.But if somehow someone clicks on cancel it closes the server connection..Saying "Server closed the connection"..This not only affects here.But on all the Dialog box i add in the server.If someone clicks on the right tab it closes the connection Please help..
This is my OnPlayerConnect Code
Код:
public OnPlayerConnect(playerid) { new string[MAX_PLAYER_NAME]; ResetStats(playerid); new Country[256]; GetPlayerCountry(playerid,Country); new mess[256],IP[256]; new plname[256]; GetPlayerIp(playerid,IP,sizeof(IP)); format(mess,sizeof(mess),"%s has joined the server.[Country: %s |IP Address: %s |Ping: %i ]",plname,Country,IP,GetPlayerPing(playerid)); printf(mess); ABroadCast(COLOR_YELLOW,mess,1); GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~ ~b~80z ~i~ ~P~Gang ~W~Warz", 2000, 3); SendClientMessage(playerid, COLOR_RED, "This Server contains Violent acts ,you've been warned"); gActivePlayers[playerid]++; numplayers++; format(string, sizeof(string), "%s.ini", PlayerName(playerid)); if(!dini_Exists(string)) { gPlayerAccount[playerid] = 0; new regstring[256]; new regname[64]; SendClientMessage(playerid, COLOR_YELLOW, "You dont have an account. Please register your account to proceed."); GetPlayerName(playerid,regname,sizeof(regname)); format(regstring,sizeof(regstring),"80'z Gang WarZ\nPlease register your account by typing you password below"); ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit"); return 1; } else { gPlayerAccount[playerid] = 1; new loginstring[256]; new loginname[64]; SendClientMessage(playerid, COLOR_WHITE, "SERVER: That name is registered, please wait to login"); SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now login by typing your password below"); GetPlayerName(playerid,loginname,sizeof(loginname)); format(loginstring,sizeof(loginstring),"80z Gang WarZ\nThat name is registered. please enter your password below"); ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit"); //========= [ Car Exports ] ==========// SetPlayerCheckpoint(playerid, 2237.41, -2492.02, 13.54, 5.0); new vehicleName[32] = ""; for(new i=0; i < MAX_EXPORTVEHICLES; i++) { if(ExportVehicles[i] == ExportVehicle) { format(vehicleName, sizeof(vehicleName), "%s",ExportVehicleNames[i] ); } } if(strlen(vehicleName) != 0) { format(string, sizeof(string), "Exports are currently buying %s's.",vehicleName); SendClientMessage(playerid, COLOR_NICEBLUE, string); } TextDrawShowForPlayer(playerid, NWORP1); //=========================[MAP-ICONS]====================================== SetPlayerMapIcon( playerid, 49, 2310.99, -1649.97, 14.18, 49, 0);//TGB SetPlayerMapIcon( playerid, 12, 1553.3510, -1675.4082, 16.1953, 30, 0); // LSPD gOoc[playerid] = 0; InJail[playerid] = 0; InStunt[playerid] = 0; return 1; } }