SA-MP Forums Archive
Do you know how to fixe that ? TSConnector - 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)
+--- Thread: Do you know how to fixe that ? TSConnector (/showthread.php?tid=545933)



Do you know how to fixe that ? TSConnector - DiamantEspace18 - 11.11.2014

Yo ! I've a two problem , one of these is I need to do the command twice to get the channelid and the other is the clientid who return 0 but i've not the clientid 0.
Can someone find one of these problems ?

Here it is my code
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/test", cmdtext, true, 10) == 0)
	{
	    for (new player = 0; player <= MAX_PLAYERS; player++)
		{
			new Float:x, Float:y, Float:z;
    		GetPlayerPos(playerid, x, y, z);
			if(IsPlayerInRangeOfPoint(player, 15.0, x, y, z))
			{
				new ip[16];
				GetPlayerIp(player,ip,sizeof(ip));
				//new clientid = TSC_GetClientIdByUid("SGGNj0J/0z8bQAD7TyyrRzY6I/g=");
    			        new clientid = TSC_GetClientIdByIpAddress(ip);
    			        new channel[19] = "Channel 9";
    			        TSC_CreateChannel(channel);
 				new string[64];
				new channelid = TSC_GetChannelIdByName(channel);
				format(string,sizeof(string),"Clientid = %i and channelid = %i and ip = %s and %s",clientid,channelid,ip,channel);
				SendClientMessage(playerid, -1,string);
				TSC_MoveClient(clientid, channelid);
				return 1;
    		         }
    	         }
		return 1;
	}
	return 0;
}
Thanks for the future help