SA-MP Forums Archive
Player disconnects on command, - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Player disconnects on command, (/showthread.php?tid=259821)



Player disconnects on command, - Jack_Leslie - 06.06.2011

I've got a /clothes and /skin command, and if a player inputs either of them they disconnect, the server doesn't crash, just them.

Here is what the command uses:
Код:
public IsAtClothShop(playerid)
{
    if(IsPlayerConnected(playerid))
	{
        if(IsPlayerInRangeOfPoint(playerid,25.0,286.148986,-40.644397,1001.515625) || IsPlayerInRangeOfPoint(playerid,25.0,286.800994,-82.547599,1001.515625))
		{//Binco & Suburban
		    return 1;
		}
		else if(IsPlayerInRangeOfPoint(playerid,296.919982,-108.071998,1001.515625) || IsPlayerInRangeOfPoint(playerid,50.0,314.820983,-141.431991,999.601562))
		{//Zip & Victim
		    return 1;
		}
	}
	return 0;
}
It detects if their in a clothing store and if not it tells them to go to one, I'm almost positive it has something to do with that.


Re: Player disconnects on command, - cessil - 06.06.2011

i don't believe that's the problem


Re: Player disconnects on command, - Jack_Leslie - 06.06.2011

Well here's one of the commands that people disconnect when doing:

Код:
if(strcmp(cmd, "/skin", true) == 0)
	{
	if(!IsAtClothShop(playerid)) return SendClientMessage(playerid, 0x919191FF, "You are not inside a clothing store.");
 	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp)) return SendClientMessage(playerid, 0x919191FF, "Usage: /skin [SKINID]");
 	new chosenskin = strval(tmp);
 	SetPlayerSkin(playerid, chosenskin);
 	PlayerInfo[playerid][pModel] = chosenskin;
 	return 1;
 }
When I first implanted it it worked but for some reason it's not anymore.


Re: Player disconnects on command, - Namaco - 06.06.2011

The command doesnt show anything that would make them disconnect, maybe it is a conflict between few commands and this?


Re: Player disconnects on command, - Basicz - 06.06.2011

Errr..... I saw something wrong in....

pawn Код:
public IsAtClothShop(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid,25.0,286.148986,-40.644397,1001.515625) || IsPlayerInRangeOfPoint(playerid,25.0,286.800994,-82.547599,1001.515625))
        {//Binco & Suburban
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,/* Here, no ranges.*/296.919982,-108.071998,1001.515625) || IsPlayerInRangeOfPoint(playerid,50.0,314.820983,-141.431991,999.601562))
        {//Zip & Victim
            return 1;
        }
    }
    return 0;
}
Also I didn't believe that can be the problem....


Re: Player disconnects on command, - Jack_Leslie - 06.06.2011

Quote:
Originally Posted by Basicz
Посмотреть сообщение
Errr..... I saw something wrong in....

pawn Код:
public IsAtClothShop(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid,25.0,286.148986,-40.644397,1001.515625) || IsPlayerInRangeOfPoint(playerid,25.0,286.800994,-82.547599,1001.515625))
        {//Binco & Suburban
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,/* Here, no ranges.*/296.919982,-108.071998,1001.515625) || IsPlayerInRangeOfPoint(playerid,50.0,314.820983,-141.431991,999.601562))
        {//Zip & Victim
            return 1;
        }
    }
    return 0;
}
Also I didn't believe that can be the problem....
Didn't see that, but for some odd reason it fixed it, thankyou.


Re: Player disconnects on command, - Basicz - 06.06.2011

Ohhh, your welcome
You need to read the script carefully to repair if something is wrong. :P


Re: Player disconnects on command, - Ash. - 06.06.2011

Hang on; although granted there was an error in the script - surely the compiler would of picked that up as a missing argument?