Server Closed The Connection After Spawning? -
Youssef214 - 15.02.2014
Hello,When I Spawn It Says "Server closed the connection." What is the problem in this?,please help.
Re: Server Closed The Connection After Spawning? -
Twizted - 15.02.2014
You've got to provide the code after
public OnPlayerSpawn in order to get assistance.
Re: Server Closed The Connection After Spawning? -
Beckett - 15.02.2014
Show us your OnPlayerSpawn callback.
Re: Server Closed The Connection After Spawning? -
Youssef214 - 15.02.2014
pawn Код:
#define DIALOG_WEAPONS 14
public OnPlayerSpawn(playerid)
{
switch(pClass[playerid])
{
case 0..3:
{
SetPlayerColor(playerid, 0x00FF0069);
if(Invaded[Grove] == 0)
{
tCP[Grove] = gTeam[playerid];
}
}
case 4..6:
{
SetPlayerColor(playerid, 0xFF00FF96);
if(Invaded[Ballas] == 0)
{
tCP[Ballas] = gTeam[playerid];
}
}
case 7..9:
{
SetPlayerColor(playerid, 0xFFFF0096);
if(Invaded[Vagos] == 0)
{
tCP[Vagos] = gTeam[playerid];
}
}
case 10..12:
{
SetPlayerColor(playerid, 0x0000FF96);
if(Invaded[Police] == 0)
{
tCP[Police] = gTeam[playerid];
}
}
case 13..16:
{
SetPlayerColor(playerid, 0x00FFFF96);
if(Invaded[Aztecas] == 0)
{
tCP[Aztecas] = gTeam[playerid];
}
}
}
SendClientMessage(playerid,0xFF66FFAA,"Type /help /cmds /rules");
PlayerPlaySound(playerid, 1184,0,0,0);
OnDuty[playerid] = 0;
if(WeaponSpawn[playerid] == 1)
{
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "NightStick ($200)\nBaseball Bat ($200)\nChainsaw ($500)\n9mm Pistol ($700)\nSlienced 9mm Pistol ($800)\nDesert Eagle ($1000)\nShotgun ($1200)\nSawnoff Shotgun ($1500)\nCombat Shotgun ($2500)\nMicro SMG ($3000)\nTec-9 ($3000)\nMP5 ($4000)\nAK-47 ($5000)\nM4 ($5000)\nCountry Rifle ($6000)\nSniper Rifle ($7000)", "Buy", "Cancel");
}
return 1;
}
Re: Server Closed The Connection After Spawning? -
Twizted - 15.02.2014
This may be the solution. Read the comment. If it doesn't work, post again. Also, remove the dialog and check If it works.
pawn Код:
#define DIALOG_WEAPONS 14
public OnPlayerSpawn(playerid)
{
switch(pClass[playerid])
{
case 0 .. 3: // before: case 0..3 -- the spacing between the numbers and the two dots was POSSIBLY causing the problem, because on SA:MP Wiki the spaces are like these that I fixed.
{
SetPlayerColor(playerid, 0x00FF0069);
if(Invaded[Grove] == 0)
{
tCP[Grove] = gTeam[playerid];
}
}
case 4 .. 6:
{
SetPlayerColor(playerid, 0xFF00FF96);
if(Invaded[Ballas] == 0)
{
tCP[Ballas] = gTeam[playerid];
}
}
case 7 .. 9:
{
SetPlayerColor(playerid, 0xFFFF0096);
if(Invaded[Vagos] == 0)
{
tCP[Vagos] = gTeam[playerid];
}
}
case 10 .. 12:
{
SetPlayerColor(playerid, 0x0000FF96);
if(Invaded[Police] == 0)
{
tCP[Police] = gTeam[playerid];
}
}
case 13 .. 16:
{
SetPlayerColor(playerid, 0x00FFFF96);
if(Invaded[Aztecas] == 0)
{
tCP[Aztecas] = gTeam[playerid];
}
}
}
SendClientMessage(playerid,0xFF66FFAA,"Type /help /cmds /rules");
PlayerPlaySound(playerid, 1184,0,0,0);
OnDuty[playerid] = 0;
if(WeaponSpawn[playerid] == 1)
{
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "NightStick ($200)\nBaseball Bat ($200)\nChainsaw ($500)\n9mm Pistol ($700)\nSlienced 9mm Pistol ($800)\nDesert Eagle ($1000)\nShotgun ($1200)\nSawnoff Shotgun ($1500)\nCombat Shotgun ($2500)\nMicro SMG ($3000)\nTec-9 ($3000)\nMP5 ($4000)\nAK-47 ($5000)\nM4 ($5000)\nCountry Rifle ($6000)\nSniper Rifle ($7000)", "Buy", "Cancel");
}
return 1;
}
Re: Server Closed The Connection After Spawning? -
Konstantinos - 15.02.2014
Because I've seen this before, spacing does NOTHING. It won't fix a problem, it's just up to user (being readable is always recommended).
Search for all the parts that use
Kick function.
Re: Server Closed The Connection After Spawning? -
Youssef214 - 15.02.2014
still not working,i am looking for a Kick Function
Re: Server Closed The Connection After Spawning? -
Youssef214 - 15.02.2014
i fixed this problem by myself,i found something wrong on /setmaxping