15.02.2014, 09:18
Hello,When I Spawn It Says "Server closed the connection." What is the problem in this?,please help.
#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;
}
#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;
}