15.02.2018, 11:54
I've found a really weird bug,
If I connect with an unregistered name and I register, I can't spawn.
I thought maybe I need to relog in order to login and maybe then I can spawn?
No, It shows me register dialog again with the same issue!
Here's my on player connect
If I connect with an unregistered name and I register, I can't spawn.
I thought maybe I need to relog in order to login and maybe then I can spawn?
No, It shows me register dialog again with the same issue!
Here's my on player connect
Код:
public OnPlayerConnect(playerid) { TogglePlayerClock(playerid, 1); SetPlayerColor(playerid, COLOR_GREY); GetPlayerName(playerid, PlayerName[playerid], MAX_PLAYER_NAME); new DB_Query[115]; //Resetting player information. pInfo[playerid][Kills] = 0; pInfo[playerid][Deaths] = 0; pInfo[playerid][PasswordFails] = 0; IsPlayerInLobby[playerid] = 0; PlayerTotalKills[playerid] = 0; // We put there the killing spree of the incoming player to 0. InArena1[playerid] = 0; InArena2[playerid] = 0; connected[playerid] = true; AgainMessage[playerid] = false; RandomWeapon[playerid] = 0; GetPlayerName(playerid, pInfo[playerid][Name], MAX_PLAYER_NAME); // Getting the player's name. Corrupt_Check[playerid]++; mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `PLAYERS` WHERE `USERNAME` = '%e' LIMIT 1", pInfo[playerid][Name]); mysql_tquery(Database, DB_Query, "OnPlayerDataCheck", "ii", playerid, Corrupt_Check[playerid]); // All the player's TD, will be placed there. PYWNICA1[playerid] = TextDrawCreate(231.000000, -1.000000, "_"); TextDrawBackgroundColor(PYWNICA1[playerid], 255); TextDrawFont(PYWNICA1[playerid], 1); TextDrawLetterSize(PYWNICA1[playerid], 0.500000, 1.499999); TextDrawColor(PYWNICA1[playerid], -1); TextDrawSetOutline(PYWNICA1[playerid], 0); TextDrawSetProportional(PYWNICA1[playerid], 1); TextDrawSetShadow(PYWNICA1[playerid], 1); TextDrawUseBox(PYWNICA1[playerid], 1); TextDrawBoxColor(PYWNICA1[playerid], 100); TextDrawTextSize(PYWNICA1[playerid], 388.000000, -13.000000); PYWNICA2[playerid] = TextDrawCreate(262.000000, 2.000000, "samp-lsdm.ga"); TextDrawBackgroundColor(PYWNICA2[playerid], 255); TextDrawFont(PYWNICA2[playerid], 3); TextDrawLetterSize(PYWNICA2[playerid], 0.419999, 1.099999); TextDrawColor(PYWNICA2[playerid], -1); TextDrawSetOutline(PYWNICA2[playerid], 0); TextDrawSetProportional(PYWNICA2[playerid], 1); TextDrawSetShadow(PYWNICA2[playerid], 1); specname[playerid] = CreatePlayerTextDraw(playerid, 14.000000, 251.000000, "_"); PlayerTextDrawBackgroundColor(playerid, specname[playerid], 255); PlayerTextDrawFont(playerid, specname[playerid], 1); PlayerTextDrawLetterSize(playerid, specname[playerid], 0.310000, 0.799998); PlayerTextDrawColor(playerid, specname[playerid], -1); PlayerTextDrawSetOutline(playerid, specname[playerid], 0); PlayerTextDrawSetProportional(playerid, specname[playerid], 1); PlayerTextDrawSetShadow(playerid, specname[playerid], 1); specid[playerid] = CreatePlayerTextDraw(playerid, 14.000000, 262.000000, "_"); PlayerTextDrawBackgroundColor(playerid, specid[playerid], 255); PlayerTextDrawFont(playerid, specid[playerid], 1); PlayerTextDrawLetterSize(playerid, specid[playerid], 0.310000, 0.799998); PlayerTextDrawColor(playerid, specid[playerid], -1); PlayerTextDrawSetOutline(playerid, specid[playerid], 0); PlayerTextDrawSetProportional(playerid, specid[playerid], 1); PlayerTextDrawSetShadow(playerid, specid[playerid], 1); specfps[playerid] = CreatePlayerTextDraw(playerid, 13.000000, 273.000000, "_"); PlayerTextDrawBackgroundColor(playerid, specfps[playerid], 255); PlayerTextDrawFont(playerid, specfps[playerid], 1); PlayerTextDrawLetterSize(playerid, specfps[playerid], 0.310000, 0.799998); PlayerTextDrawColor(playerid, specfps[playerid], -1); PlayerTextDrawSetOutline(playerid, specfps[playerid], 0); PlayerTextDrawSetProportional(playerid, specfps[playerid], 1); PlayerTextDrawSetShadow(playerid, specfps[playerid], 1); specping[playerid] = CreatePlayerTextDraw(playerid, 14.000000, 284.000000, "_"); PlayerTextDrawBackgroundColor(playerid, specping[playerid], 255); PlayerTextDrawFont(playerid, specping[playerid], 1); PlayerTextDrawLetterSize(playerid, specping[playerid], 0.310000, 0.799998); PlayerTextDrawColor(playerid, specping[playerid], -1); PlayerTextDrawSetOutline(playerid, specping[playerid], 0); PlayerTextDrawSetProportional(playerid, specping[playerid], 1); PlayerTextDrawSetShadow(playerid, specping[playerid], 1); specpacketloss[playerid] = CreatePlayerTextDraw(playerid, 14.000000, 296.000000, "_"); PlayerTextDrawBackgroundColor(playerid, specpacketloss[playerid], 255); PlayerTextDrawFont(playerid, specpacketloss[playerid], 1); PlayerTextDrawLetterSize(playerid, specpacketloss[playerid], 0.310000, 0.799998); PlayerTextDrawColor(playerid, specpacketloss[playerid], -1); PlayerTextDrawSetOutline(playerid, specpacketloss[playerid], 0); PlayerTextDrawSetProportional(playerid, specpacketloss[playerid], 1); PlayerTextDrawSetShadow(playerid, specpacketloss[playerid], 1); spectatorinfo[playerid] = CreatePlayerTextDraw(playerid, 22.000000, 232.000000, "SPECTATOR INFO"); PlayerTextDrawBackgroundColor(playerid, spectatorinfo[playerid], 255); PlayerTextDrawFont(playerid, spectatorinfo[playerid], 1); PlayerTextDrawLetterSize(playerid, spectatorinfo[playerid], 0.379999, 1.499999); PlayerTextDrawColor(playerid, spectatorinfo[playerid], -1); PlayerTextDrawSetOutline(playerid, spectatorinfo[playerid], 0); PlayerTextDrawSetProportional(playerid, spectatorinfo[playerid], 1); PlayerTextDrawSetShadow(playerid, spectatorinfo[playerid], 1); spechealth[playerid] = CreatePlayerTextDraw(playerid, 14.000000, 309.000000, "_"); PlayerTextDrawBackgroundColor(playerid, spechealth[playerid], 255); PlayerTextDrawFont(playerid, spechealth[playerid], 1); PlayerTextDrawLetterSize(playerid, spechealth[playerid], 0.310000, 0.799998); PlayerTextDrawColor(playerid, spechealth[playerid], -1); PlayerTextDrawSetOutline(playerid, spechealth[playerid], 0); PlayerTextDrawSetProportional(playerid, spechealth[playerid], 1); PlayerTextDrawSetShadow(playerid, spechealth[playerid], 1); // Transparent black bar blackBAR[playerid] = TextDrawCreate(660.000000, 432.000000, "_"); TextDrawBackgroundColor(blackBAR[playerid], 255); TextDrawFont(blackBAR[playerid], 1); TextDrawLetterSize(blackBAR[playerid], 0.500000, 2.500000); TextDrawColor(blackBAR[playerid], -1); TextDrawSetOutline(blackBAR[playerid], 0); TextDrawSetProportional(blackBAR[playerid], 1); TextDrawSetShadow(blackBAR[playerid], 1); TextDrawUseBox(blackBAR[playerid], 1); TextDrawBoxColor(blackBAR[playerid], 100); TextDrawTextSize(blackBAR[playerid], -20.000000, -21.000000); // Points Textdraw's CASH[playerid] = TextDrawCreate(495.000000, 79.000000, "_"); TextDrawBackgroundColor(CASH[playerid],255); TextDrawFont(CASH[playerid], 1); TextDrawLetterSize(CASH[playerid], 0.529999, 2.000000); TextDrawColor(CASH[playerid], -1); TextDrawSetOutline(CASH[playerid], 0); TextDrawSetProportional(CASH[playerid], 1); TextDrawSetShadow(CASH[playerid], 1); TextDrawUseBox(CASH[playerid], 1); TextDrawBoxColor(CASH[playerid], 227526655); TextDrawTextSize(CASH[playerid], 613.000000, 11.000000); // You killed: Wallen, Killed By: Wallen. killed[playerid] = CreatePlayerTextDraw(playerid, 247.000000, 347.000000, "___"); PlayerTextDrawBackgroundColor(playerid, killed[playerid], 255); PlayerTextDrawFont(playerid, killed[playerid], 1); PlayerTextDrawLetterSize(playerid, killed[playerid], 0.429999, 1.899999); PlayerTextDrawColor(playerid, killed[playerid], 227526655); PlayerTextDrawSetOutline(playerid, killed[playerid], 0); PlayerTextDrawSetProportional(playerid, killed[playerid], 1); PlayerTextDrawSetShadow(playerid, killed[playerid], 1); killedby[playerid] = CreatePlayerTextDraw(playerid, 247.000000, 347.000000, "___"); PlayerTextDrawBackgroundColor(playerid, killedby[playerid], 255); PlayerTextDrawFont(playerid, killedby[playerid], 1); PlayerTextDrawLetterSize(playerid, killedby[playerid], 0.429999, 1.899999); PlayerTextDrawColor(playerid, killedby[playerid], 227526655); PlayerTextDrawSetOutline(playerid, killedby[playerid], 0); PlayerTextDrawSetProportional(playerid, killedby[playerid], 1); PlayerTextDrawSetShadow(playerid, killedby[playerid], 1); // Points Textdraw's EARNS[playerid] = CreatePlayerTextDraw(playerid, 301.000000, 100.000000, "+"); PlayerTextDrawBackgroundColor(playerid, EARNS[playerid], 255); PlayerTextDrawFont(playerid, EARNS[playerid], 2); PlayerTextDrawLetterSize(playerid, EARNS[playerid], 0.449999, 2.099999); PlayerTextDrawColor(playerid, EARNS[playerid], 227526655); PlayerTextDrawSetOutline(playerid, EARNS[playerid], 0); PlayerTextDrawSetProportional(playerid, EARNS[playerid], 1); PlayerTextDrawSetShadow(playerid, EARNS[playerid], 1); CASH2[playerid] = TextDrawCreate(497.000000, 81.000000, "_"); TextDrawBackgroundColor(CASH2[playerid], 255); TextDrawFont(CASH2[playerid], 1); TextDrawLetterSize(CASH2[playerid], 0.500000, 1.599999); TextDrawColor(CASH2[playerid], -1); TextDrawSetOutline(CASH2[playerid], 0); TextDrawSetProportional(CASH2[playerid], 1); TextDrawSetShadow(CASH2[playerid], 1); TextDrawUseBox(CASH2[playerid], 1); TextDrawBoxColor(CASH2[playerid], 255); TextDrawTextSize(CASH2[playerid], 611.000000, 11.000000); /* CASH3[playerid] = TextDrawCreate(527.000000, 105.000000, "points"); TextDrawBackgroundColor(CASH3[playerid], 44627711); TextDrawFont(CASH3[playerid], 3); TextDrawLetterSize(CASH3[playerid], 0.480000, 1.099999); TextDrawColor(CASH3[playerid], 255); TextDrawSetOutline(CASH3[playerid], 1); TextDrawSetProportional(CASH3[playerid], 1); TextDrawUseBox(CASH3[playerid], 1); TextDrawBoxColor(CASH3[playerid], 255); TextDrawTextSize(CASH3[playerid], 580.000000, 1.000000); */ CASH4[playerid] = TextDrawCreate(500.000000, 79.000000, "$0000000"); TextDrawBackgroundColor(CASH4[playerid], 632941823); TextDrawFont(CASH4[playerid], 3); TextDrawLetterSize(CASH4[playerid], 0.600000, 2.000000); TextDrawColor(CASH4[playerid], 255); TextDrawSetOutline(CASH4[playerid], 1); TextDrawSetProportional(CASH4[playerid], 1); // Health Textdraw HPP[playerid] = TextDrawCreate(20.000000, 431.000000, "HP: 100"); TextDrawBackgroundColor(HPP[playerid], 16711935); TextDrawFont(HPP[playerid], 3); TextDrawLetterSize(HPP[playerid], 0.449999, 1.800000); TextDrawColor(HPP[playerid], 255); TextDrawSetOutline(HPP[playerid], 1); TextDrawSetProportional(HPP[playerid], 1); // Killingspree textdraw. KILLINGSPREE[playerid] = CreatePlayerTextDraw(playerid, -36.000000, 241.000000, "_"); PlayerTextDrawBackgroundColor(playerid, KILLINGSPREE[playerid], 255); PlayerTextDrawFont(playerid, KILLINGSPREE[playerid], 1); PlayerTextDrawLetterSize(playerid, KILLINGSPREE[playerid], 1.070000, 1.599999); PlayerTextDrawColor(playerid, KILLINGSPREE[playerid], -1); PlayerTextDrawSetOutline(playerid, KILLINGSPREE[playerid], 0); PlayerTextDrawSetProportional(playerid, KILLINGSPREE[playerid], 1); PlayerTextDrawSetShadow(playerid, KILLINGSPREE[playerid], 1); PlayerTextDrawUseBox(playerid, KILLINGSPREE[playerid], 1); PlayerTextDrawBoxColor(playerid, KILLINGSPREE[playerid], 90); PlayerTextDrawTextSize(playerid, KILLINGSPREE[playerid], 180.000000, 0.000000); KILLINGSPREE2[playerid] = CreatePlayerTextDraw(playerid, 8.000000, 239.000000, "Killingstreak= 0"); PlayerTextDrawBackgroundColor(playerid, KILLINGSPREE2[playerid], 255); PlayerTextDrawFont(playerid, KILLINGSPREE2[playerid], 3); PlayerTextDrawLetterSize(playerid, KILLINGSPREE2[playerid], 0.470000, 1.899999); PlayerTextDrawColor(playerid, KILLINGSPREE2[playerid], 227526655); PlayerTextDrawSetOutline(playerid, KILLINGSPREE2[playerid], 0); PlayerTextDrawSetProportional(playerid, KILLINGSPREE2[playerid], 1); PlayerTextDrawSetShadow(playerid, KILLINGSPREE2[playerid], 2); // Just a KILLS player info textdraw. KILLS[playerid] = TextDrawCreate(152.000000, 439.000000, "Kills:0"); TextDrawBackgroundColor(KILLS[playerid], 227525802); TextDrawFont(KILLS[playerid], 3); TextDrawLetterSize(KILLS[playerid], 0.500000, 0.899999); TextDrawColor(KILLS[playerid], 255); TextDrawSetOutline(KILLS[playerid], 1); TextDrawSetProportional(KILLS[playerid], 1); DEATHS[playerid] = TextDrawCreate(255.000000, 439.000000, "Deaths: 0"); TextDrawBackgroundColor(DEATHS[playerid], 227525802); TextDrawFont(DEATHS[playerid], 3); TextDrawLetterSize(DEATHS[playerid], 0.500000, 0.899999); TextDrawColor(DEATHS[playerid], 255); TextDrawSetOutline(DEATHS[playerid], 1); TextDrawSetProportional(DEATHS[playerid], 1); RATIO[playerid] = TextDrawCreate(379.000000, 439.000000, "Ratio:0.00"); TextDrawBackgroundColor(RATIO[playerid], 227525802); TextDrawFont(RATIO[playerid], 3); TextDrawLetterSize(RATIO[playerid], 0.500000, 0.899999); TextDrawColor(RATIO[playerid], 255); TextDrawSetOutline(RATIO[playerid], 1); TextDrawSetProportional(RATIO[playerid], 1); LEVEL[playerid] = TextDrawCreate(485.000000, 439.000000, "Level: 0"); TextDrawBackgroundColor(LEVEL[playerid], 227525802); TextDrawFont(LEVEL[playerid], 3); TextDrawLetterSize(LEVEL[playerid], 0.500000, 0.899999); TextDrawColor(LEVEL[playerid], 255); TextDrawSetOutline(LEVEL[playerid], 1); TextDrawSetProportional(LEVEL[playerid], 1); // Network TD playerid. FPSXD[playerid] = TextDrawCreate(601.000000, 432.000000, "FPS: 50"); TextDrawBackgroundColor(FPSXD[playerid], 255); TextDrawFont(FPSXD[playerid], 2); TextDrawLetterSize(FPSXD[playerid], 0.180000, 0.599999); TextDrawColor(FPSXD[playerid], 227526655); TextDrawSetOutline(FPSXD[playerid], 0); TextDrawSetProportional(FPSXD[playerid], 1); TextDrawSetShadow(FPSXD[playerid], 1); PINGXD[playerid] = TextDrawCreate(601.000000, 440.000000, "PING: 60"); TextDrawBackgroundColor(PINGXD[playerid], 255); TextDrawFont(PINGXD[playerid], 2); TextDrawLetterSize(PINGXD[playerid], 0.180000, 0.599999); TextDrawColor(PINGXD[playerid], 227526655); TextDrawSetOutline(PINGXD[playerid], 0); TextDrawSetProportional(PINGXD[playerid], 1); TextDrawSetShadow(PINGXD[playerid], 1); // Spectator Info TD blackspecbox = TextDrawCreate(14.000000, 250.000000, "_"); TextDrawBackgroundColor(blackspecbox, 255); TextDrawFont(blackspecbox, 1); TextDrawLetterSize(blackspecbox, 0.950000, 8.299997); TextDrawColor(blackspecbox, -1); TextDrawSetOutline(blackspecbox, 0); TextDrawSetProportional(blackspecbox, 1); TextDrawSetShadow(blackspecbox, 1); TextDrawUseBox(blackspecbox, 1); TextDrawBoxColor(blackspecbox, 70); TextDrawTextSize(blackspecbox, 137.000000, 0.000000); //Black death box deathbox1 = TextDrawCreate(660.000000, -11.000000, "_"); TextDrawBackgroundColor(deathbox1, 255); TextDrawFont(deathbox1, 1); TextDrawLetterSize(deathbox1, 0.500000, 7.000000); TextDrawColor(deathbox1, -1); TextDrawSetOutline(deathbox1, 0); TextDrawSetProportional(deathbox1, 1); TextDrawSetShadow(deathbox1, 1); TextDrawUseBox(deathbox1, 1); TextDrawBoxColor(deathbox1, 140); TextDrawTextSize(deathbox1, -250.000000, 0.000000); deathbox2 = TextDrawCreate(660.000000, 394.000000, "_"); TextDrawBackgroundColor(deathbox2, 255); TextDrawFont(deathbox2, 1); TextDrawLetterSize(deathbox2, 0.500000, 7.000000); TextDrawColor(deathbox2, -1); TextDrawSetOutline(deathbox2, 0); TextDrawSetProportional(deathbox2, 1); TextDrawSetShadow(deathbox2, 1); TextDrawUseBox(deathbox2, 1); TextDrawBoxColor(deathbox2, 140); TextDrawTextSize(deathbox2, -250.000000, 0.000000); // End of player's TD's. // Announcing a new player connection (DONT DELETE ANYTHING FROM THERE) new str[500], name[MAX_PLAYER_NAME]; new ip[16], country[32], isp[32], city[32]; GetPlayerName(playerid, name, sizeof(name)); if(pInfo[playerid][Admin] == 1) { GetIPCountry(ip, country, sizeof country); GetPlayerIp(playerid,ip,sizeof(ip)); format(str,sizeof(str), "{c3c3c3}* (INFO) %s joined the game (ID: %d || Country: %s )",name, playerid, country); SendMessageToAdmins(str); } else if(pInfo[playerid][Admin] == 2) { GetPlayerIp(playerid, ip, 16); GetIPCountry(ip, country, sizeof country); GetIPISP(ip, isp, sizeof isp); GetIPCity(ip, city, sizeof city); GetPlayerIp(playerid,ip,sizeof(ip)); format(str,sizeof(str), "{c3c3c3}* (INFO) %s joined the game (ID: %d || IP: %s || Country: %s || City: %s || ISP: %s)",name, playerid, ip, country, city, isp); SendMessageToAdmins(str); } else if(pInfo[playerid][Admin] == 3) { GetPlayerIp(playerid, ip, 16); GetIPCountry(ip, country, sizeof country); GetIPISP(ip, isp, sizeof isp); GetIPCity(ip, city, sizeof city); GetPlayerIp(playerid,ip,sizeof(ip)); format(str,sizeof(str), "{c3c3c3}* (INFO) %s joined the game (ID: %d || IP: %s || Country: %s || City: %s || ISP: %s)",name, playerid, ip, country, city, isp); SendMessageToAdmins(str); } format(str,sizeof(str), "{c3c3c3}(INFO) %s (ID: %d) joined the game !",name, playerid); SendClientMessageToAll(playerid, str); // Messages SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, "{1DBAF7}(INFO) Please check /cmds(/commands), /respect, /points, /rules to know more about the server."); // Detecting the player TAG. if he have [SN] tag he gonna be recognized as server Owner. if(strfind(name, TAGCLAN, true) == 0) { } if(strfind(name, FAKETAG, true) == 0) { new we[128], namme[MAX_PLAYER_NAME]; GetPlayerName(playerid, namme,sizeof(namme)); format(we,sizeof(we), "%s, your nickname is not allowed to join this server, please change your nick and then relog.",namme); SendClientMessage(playerid, -1,we); SetTimerEx("KickMessage", 1000, false, "i", playerid); } return 1; }