Can't connect :(
#1

Well i have a mysql script it's working fine and compiled fine no errors but my friends can't connect the server closes the connection when they try to connect i have done the following things right
1. portforwarded
2. NO errors in script
3. already setup a DB of mysql in the PhpAdmin
4. Our samp Client is the same.

Any solutions? i need help please help me i have been trying to fix this for 2 days but i failed
Reply
#2

Show me your server.cfg mate..
Reply
#3

Here you go?

Reply
#4

You have host right If so you need to bind ip.... Or your port ain't forwarded right....
Reply
#5

Nope i use Local host for the time bieng
Reply
#6

this is the code of my on player connect if this helps

PHP код:
public OnPlayerConnect(playerid)
{
    new 
string[256],Query[200];
    
    
GetPlayerName(playeridPlayerInfo[playerid][pName], 128);
    
GetPlayerIp(playeridPlayerInfo[playerid][pIP], 50);
    
ResetAllPlayerStats(playerid);
    
    
SetPlayerColor(playeridCOLOR_DEAD);
       if (
IsPlayerNPC(playerid))
    {
    new 
ip_addr_npc[64+1];
    new 
ip_addr_server[64+1];
    
GetServerVarAsString("bind",ip_addr_server,64);
    
GetPlayerIp(playerid,ip_addr_npc,64);
    if(!
strlen(ip_addr_server)) {
     
ip_addr_server "127.0.0.1";
    }
    if(
strcmp(ip_addr_npc,ip_addr_server,true) != 0) {
     
// this bot is remote connecting
      
printf("NPC: Remote NPC Attempting To Connect From %s And I'm Kicking It.",ip_addr_npc);
      
Kick(playerid);
      return 
0;
    }
     
printf("NPC: Connection From %s Is Allowed.",ip_addr_npc);
       
format(stringsizeof(string), "* NPC %s (%i) Has Joined The Server.",PlayerInfo[playerid][pName],playerid);
    
SendClientMessageToOthers(playeridCOLOR_DEADstring);
       }else{
// End of NPC Check
    //DestroyGPSData(playerid);
    
new PIP[56]; //Creates the IP string
    
GetPlayerIp(playeridPIP56); //Gets the players IP
    
format(Querysizeof(Query), "SELECT * FROM banned WHERE IP = '%s'"PIP); //Checks if the players IP is in the database, if so it will kick them :)
    
mysql_query(Query);//Queries
    
mysql_store_result(); //Stores the result
    
if(mysql_num_rows() != 0//If the ip is found
    
{
    
SendClientMessage(playeridCOLOR_ERROR"Your IP Has Been Banned Due To Abuse, Visit "WEBSITE" For More Info.");
    
Kick(playerid);
    return 
0;
       }
    
PlayerInfo[playerid][pClassselection] = 10;
    
// Create Intro textdraw for when a player joins the server:
    
TextDrawSetString(MediumTextdraw0[playerid], " ~n~~y~******~n~~b~Cops ~w~And ~r~Robbers~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
    
format(stringsizeof(string), "~g~%s",ServerInfo[sMapName]);
    
TextDrawSetString(MediumTextdraw1[playerid], string);
    
TextDrawSetString(MediumTextdraw2[playerid], "- This Is ~r~Not ~w~A Deathmatch Server~n~- Do ~r~Not ~w~Attack People For No Reason~n~Or You Will Be Kicked / Banned~n~ ~n~- Respect Admins And Other Players~n~ ~n~- Type ~y~/help ~w~For Help And Game Information.~n~- Type ~y~/rules ~w~For Server Rules");
    
format(stringsizeof(string), " ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~~y~Version %s~n~ ~n~~b~%s"VERSIONWEBSITE);
    
TextDrawSetString(MediumTextdraw3[playerid], string);
    
TextDrawShowForPlayer(playeridMediumTextdraw0[playerid]);
    
TextDrawShowForPlayer(playeridMediumTextdraw1[playerid]);
    
TextDrawShowForPlayer(playeridMediumTextdraw2[playerid]);
    
TextDrawShowForPlayer(playeridMediumTextdraw3[playerid]);
    
//format(string, sizeof(string), "02[JOIN] 03%s (%d) Has Joined The Server.", PlayerInfo[playerid][pName], playerid);
    //IRC_GroupSay(gGroupID, IRC_CHANNEL, string);
     
format(stringsizeof(string), "* %s (%i) Has Joined The Server.",PlayerInfo[playerid][pName],playerid);
    
SendClientMessageToOthers(playeridCOLOR_DEADstring);
       
format(stringsizeof(string), "{FFFFFF}Welcome to {D6D631}******* {0077FF}Cops {FFFFFF}And {FF0000}Robbers{FFFFFF}- {00AAFF}%s {D6D631}Version %s",ServerInfo[sMapName],VERSION);
    
SendClientMessage(playeridCOLOR_SERVER_MAIN_MSGstring);
       
format(stringsizeof(string), "{FFFFFF}Type   {D6D631}/help  /cmds  /rules  {FFFFFF}or visit {00AAFF}%s {FFFFFF}For Game Info.",WEBSITE);
    
SendClientMessage(playeridCOLOR_SERVER_MAIN_MSGstring);
    
    
SendClientMessage(playeridCOLOR_SERVER_MAIN_MSG"{FF0000}Warning!  {FFFFFF}This Server (and GTA In General) Contains Explicit Material.");
    
format(Querysizeof(Query), "SELECT * FROM playerdata WHERE UserName = '%s'"PlayerInfo[playerid][pName]);
    
mysql_query(Query);//Queries
    
mysql_store_result(); //Stores the result
    
if(mysql_num_rows() > 0//If the user is found
    
{
    
PlayerInfo[playerid][pRegistered] = 1;
    
PlayerInfo[playerid][pLogged] = 0;
    new 
wdata[128];
    while(
mysql_retrieve_row()) //it will be running until there are no more rows to be retrieved
    
{
        switch (
CURRENT_GAMEMODE)
        {
            case 
LOS_SANTOS:
            {
            
mysql_get_field("LsResume",wdata);
            
PlayerInfo[playerid][pResume] = strval(wdata);
            
mysql_get_field("LsClassid",wdata);
            
PlayerInfo[playerid][pClass] = strval(wdata);
            }
            case 
LAS_VENTURAS:
            {
            
mysql_get_field("LvResume",wdata);
            
PlayerInfo[playerid][pResume] = strval(wdata);
            
mysql_get_field("LvClassid",wdata);
            
PlayerInfo[playerid][pClass] = strval(wdata);
            }
            case 
SAN_FIERRO:
            {
            
mysql_get_field("SfResume",wdata);
            
PlayerInfo[playerid][pResume] = strval(wdata);
            
mysql_get_field("SfClassid",wdata);
            
PlayerInfo[playerid][pClass] = strval(wdata);
            }
        }
    }
    
    }
    else
    {
    
PlayerInfo[playerid][pRegistered] = 0;
    
PlayerInfo[playerid][pLogged] = 0;
    
PlayerInfo[playerid][pClass] = 0;
    
PlayerInfo[playerid][pTeam] = TEAM_LAW;
    
PlayerInfo[playerid][pSkill] = SKILL_COP;
    }
    
mysql_free_result(); //Frees the result :)
    
format(stringsizeof(string), "555%d%d%d%d",playerid,random(9),random(9),random(9));
    
PlayerInfo[playerid][pPhoneNumber] = strval(string);
    
    
RemoveBuildingForPlayer(playerid9852497.412777.0711.531220.0);//Right Gate Of K.A.C.C Military Fuels
    
RemoveBuildingForPlayer(playerid9862497.412769.1111.531220.0);//Left Gate Of K.A.C.C Military Fuels
    //RemoveBuildingForPlayer(playerid, 11014, -2076.4375, -107.9297, 36.9688, 20.0);//Gates Of San Fierro Driving School
    //Los Santos
    
RemoveBuildingForPlayer(playerid9561634.1487,-2238.2810,13.507720.0); //Snack vender @ LS Airport
    
RemoveBuildingForPlayer(playerid9562480.9885,-1958.5117,13.583120.0); //Snack vender @ Sushi Shop in Willowfield
    
RemoveBuildingForPlayer(playerid9551729.7935,-1944.0087,13.568220.0); //Sprunk machine @ Unity Station
    
RemoveBuildingForPlayer(playerid9552060.1099,-1898.4543,13.553820.0); //Sprunk machine opposite Tony's Liqour in Willowfield
    
RemoveBuildingForPlayer(playerid9552325.8708,-1645.9584,14.827020.0); //Sprunk machine @ Ten Green Bottles
    
RemoveBuildingForPlayer(playerid9551153.9130,-1460.8893,15.796920.0); //Sprunk machine @ Market
    
RemoveBuildingForPlayer(playerid955,1788.3965,-1369.2336,15.757820.0); //Sprunk machine in Downtown Los Santos
    
RemoveBuildingForPlayer(playerid9552352.9939,-1357.1105,24.398420.0); //Sprunk machine @ Liquour shop in East Los Santos
    
RemoveBuildingForPlayer(playerid17752224.3235,-1153.0692,1025.796920.0); //Sprunk machine @ Jefferson Motel
    
RemoveBuildingForPlayer(playerid9562140.2566,-1161.7568,23.992220.0); //Snack machine @ pick'n'go market in Jefferson
    
RemoveBuildingForPlayer(playerid9562154.1199,-1015.7635,62.884020.0); //Snach machine @ Carniceria El Pueblo in Las Colinas
    
RemoveBuildingForPlayer(playerid956662.5665,-551.4142,16.335920.0); //Snack vender at Dillimore Gas Station
    
RemoveBuildingForPlayer(playerid955200.2010,-107.6401,1.551320.0); //Sprunk machine @ Blueberry Safe House
    
RemoveBuildingForPlayer(playerid9562271.4666,-77.2104,26.582420.0); //Snack machine @ Palomino Creek Library
    
RemoveBuildingForPlayer(playerid9551278.5421,372.1057,19.554720.0); //Sprunk machine @ Papercuts in Montgomery
    
RemoveBuildingForPlayer(playerid9551929.5527,-1772.3136,13.546920.0); //Sprunk machine @ Idlewood Gas Station
    //San Fierro
    
RemoveBuildingForPlayer(playerid1302, -2419.5835,984.4185,45.296920.0); //Soda machine 1 @ Juniper Hollow Gas Station
    
RemoveBuildingForPlayer(playerid1209, -2419.5835,984.4185,45.296920.0); //Soda machine 2 @ Juniper Hollow Gas Station
    
RemoveBuildingForPlayer(playerid956, -2229.2075,287.2937,35.320320.0); //Snack vender @ King's Car Park
    
RemoveBuildingForPlayer(playerid955, -1349.3947,493.1277,11.195320.0); //Sprunk machine @ SF Aircraft Carrier
    
RemoveBuildingForPlayer(playerid956, -1349.3947,493.1277,11.195320.0); //Snack vender @ SF Aircraft Carrier
    
RemoveBuildingForPlayer(playerid955, -1981.6029,142.7232,27.687520.0); //Sprunk machine @ Cranberry Station
    
RemoveBuildingForPlayer(playerid955, -2119.6245,-422.9411,35.531320.0); //Sprunk machine 1/2 @ SF Stadium
    
RemoveBuildingForPlayer(playerid955, -2097.3696,-397.5220,35.531320.0); //Sprunk machine 3 @ SF Stadium
    
RemoveBuildingForPlayer(playerid955, -2068.5593,-397.5223,35.531320.0); //Sprunk machine 3 @ SF Stadium
    
RemoveBuildingForPlayer(playerid955, -2039.8802,-397.5214,35.531320.0); //Sprunk machine 3 @ SF Stadium
    
RemoveBuildingForPlayer(playerid955, -2011.1403,-397.5225,35.531320.0); //Sprunk machine 3 @ SF Stadium
    
RemoveBuildingForPlayer(playerid955, -2005.7861,-490.8688,35.531320.0); //Sprunk machine 3 @ SF Stadium
    
RemoveBuildingForPlayer(playerid955, -2034.5267,-490.8681,35.531320.0); //Sprunk machine 3 @ SF Stadium
    
RemoveBuildingForPlayer(playerid955, -2063.1875,-490.8687,35.531320.0); //Sprunk machine 3 @ SF Stadium
    
RemoveBuildingForPlayer(playerid955, -2091.9780,-490.8684,35.531320.0); //Sprunk machine 3 @ SF Stadium
    //Las Venturas
    
RemoveBuildingForPlayer(playerid956, -1455.1298,2592.4138,55.835920.0); //Snack vender @ El Quebrados GONE
    
RemoveBuildingForPlayer(playerid955, -252.9574,2598.9048,62.858220.0); //Sprunk machine @ Las Payasadas GONE
    
RemoveBuildingForPlayer(playerid956, -252.9574,2598.9048,62.858220.0); //Snack vender @ Las Payasadas GONE
    
RemoveBuildingForPlayer(playerid9561398.7617,2223.3606,11.023420.0); //Snack vender @ Redsands West GONE
    
RemoveBuildingForPlayer(playerid955, -862.9229,1537.4246,22.587020.0); //Sprunk machine @ The Smokin' Beef Grill in Las Barrancas GONE
    
RemoveBuildingForPlayer(playerid955, -14.6146,1176.1738,19.563420.0); //Sprunk machine @ Fort Carson GONE
    
RemoveBuildingForPlayer(playerid956, -75.2839,1227.5978,19.736020.0); //Snack vender @ Fort Carson GONE
    
RemoveBuildingForPlayer(playerid9551519.3328,1055.2075,10.820320.0); //Sprunk machine @ LVA Freight Department GONE
    
RemoveBuildingForPlayer(playerid9561659.5096,1722.1096,10.828120.0); //Snack vender near Binco @ LV Airport GONE
    
RemoveBuildingForPlayer(playerid9552086.5872,2071.4958,11.057920.0); //Sprunk machine @ Sex Shop on The Strip
    
RemoveBuildingForPlayer(playerid9552319.9001,2532.0376,10.820320.0); //Sprunk machine @ Pizza co by Julius Thruway (North)
    
RemoveBuildingForPlayer(playerid9552503.2061,1244.5095,10.820320.0); //Sprunk machine @ Club in the Camels Toe
    
RemoveBuildingForPlayer(playerid9562845.9919,1294.2975,11.390620.0); //Snack vender @ Linden Station
    
RemoveBuildingForPlayer(playerid9562647.69531129.664110.218820.0); //Snack vender @ South East LV Gas Station
    //Interiors: 24/7 and Clubs
    
RemoveBuildingForPlayer(playerid1775496.0843,-23.5310,1000.679720.0); //Sprunk machine 1 @ Club in Camels Toe
    
RemoveBuildingForPlayer(playerid1775501.1219,-2.1968,1000.679720.0); //Sprunk machine 2 @ Club in Camels Toe
    
RemoveBuildingForPlayer(playerid1776501.1219,-2.1968,1000.679720.0); //Snack vender @ Club in Camels Toe
    
RemoveBuildingForPlayer(playerid1775, -19.2299,-57.0460,1003.546920.0); //Sprunk machine @ Roboi's type 24/7 stores
    
RemoveBuildingForPlayer(playerid1776, -35.9012,-57.1345,1003.546920.0); //Snack vender @ Roboi's type 24/7 stores
    
RemoveBuildingForPlayer(playerid1775, -17.0036,-90.9709,1003.546920.0); //Sprunk machine @ Other 24/7 stores
    
RemoveBuildingForPlayer(playerid1776, -17.0036,-90.9709,1003.546920.0); //Snach vender @ Others 24/7 stores
    
RemoveBuildingForPlayer(playerid1775, -32.4453, -186.69531003.632820.0); //Sprunk machine @ Other 24/7 store
    
RemoveBuildingForPlayer(playerid1776, -33.8750, -186.76561003.632820.0); //Snach vender @ Others 24/7 stores
    
RemoveBuildingForPlayer(playerid1775, -35.7266, -140.22661003.632820.0); //Sprunk machine @ Other 24/7 store
    
RemoveBuildingForPlayer(playerid1776, -16.5313, -140.29691003.632820.0); //Snach vender @ Others 24/7 stores
    
RemoveBuildingForPlayer(playerid1775, -15.1016, -140.22661003.632820.0); //Sprunk machine @ Other 24/7 store
    
RemoveBuildingForPlayer(playerid2778, -18.2734, -140.27341002.585920.0); //Video Game machine @ Other 24/7 store
    
RemoveBuildingForPlayer(playerid2681, -34.1953, -140.27341002.585920.0); //Video Game machine @ Other 24/7 store
    //Interiors: Planning Department
    
RemoveBuildingForPlayer(playerid1776330.6797178.50001020.070320.0); //Snach vender @ Planning Dept
    
RemoveBuildingForPlayer(playerid1776331.9219178.50001020.070320.0); //Snach vender @ Planning Dept
    
RemoveBuildingForPlayer(playerid1776371.5938178.45311020.070320.0); //Snach vender @ Planning Dept
    
RemoveBuildingForPlayer(playerid1776361.5625158.61721008.476620.0); //Snach vender @ Planning Dept
    
RemoveBuildingForPlayer(playerid1776374.8906188.97661008.476620.0); //Snach vender @ Planning Dept
    
RemoveBuildingForPlayer(playerid1776350.9063206.08591008.476620.0); //Snach vender @ Planning Dept
    //Interiors: Caligulas Casino Basement
    
RemoveBuildingForPlayer(playerid17762155.84381607.87501000.062520.0); //Snach vender @ caligulas Basement
    
RemoveBuildingForPlayer(playerid17762222.36721602.64061000.062520.0); //Snach vender @ caligulas Basement
    
RemoveBuildingForPlayer(playerid17762202.45311617.00781000.062520.0); //Snach vender @ caligulas Basement
    
RemoveBuildingForPlayer(playerid17762209.24221621.21091000.062520.0); //Snach vender @ caligulas Basement
    
RemoveBuildingForPlayer(playerid17752222.20311606.77341000.054720.0); //Sprunk vender @ caligulas Basement
    
RemoveBuildingForPlayer(playerid17752209.90631607.19531000.054720.0); //Sprunk vender @ caligulas Basement
    
RemoveBuildingForPlayer(playerid17752155.90631606.77341000.054720.0); //Sprunk vender @ caligulas Basement
    //Interiors: Big Smokes Crack Palace
    
RemoveBuildingForPlayer(playerid17752576.7031, -1284.42971061.093820.0); //Sprunk vender
    //Interiors: Donut Shop
    
RemoveBuildingForPlayer(playerid1776379.0391, -178.88281000.734420.0); //Snach vender @ donut shop
    
RemoveBuildingForPlayer(playerid1775373.8281, -178.14061000.734420.0); //Sprunk vender @ donut shop
    //Interiors: Ammunation
    
RemoveBuildingForPlayer(playerid1977316.8750, -140.3516998.585920.0); //Useless Box @ Ammunation
    
    
if(CHRISTMAS == 1)
    {
    
//for(new o=0; o<60; o++) CreatePlayerObject(playerid,354,0,0,0,0,0,0);
    
}
    
    }
// End of NPC Check
    
    
    
return 1;

Reply
#7

maybe your server is RP,and only allows RP names ? otherwise it would be a kick ? maybe ?
Reply
#8

What is your server version and what is their client version?

0.3x cannot connect to 0.3z and 0.3z cannot connect to 0.3x.
Reply
#9

Quote:

What is your server version and what is their client version?
0.3x cannot connect to 0.3z and 0.3z cannot connect to 0.3x.

mine is 0.3x and my friends also have 0.3x

Quote:

maybe your server is RP,and only allows RP names ? otherwise it would be a kick ? maybe ?

no it's not RP
Reply
#10

So your server version is 0.3x and not 0.3z. I'm stumped then, you sure you've port-forwarded it all correctly?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)