[HELP] /uninvite Freezes players...
#1

Hello,

This is a problem I just dont understand, how can this command Freeze a player?

Код:
if(strcmp(cmd, "/uninvite", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
 			if(IsLogged[playerid] == 0)
  		{
   			SendClientMessage(playerid, COLOR_GREY, "	You are not logged in yet.");
    			return 1;
   		}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "	USAGE: /uninvite [playerid]");
				return 1;
			}
			new para1;
			para1 = ReturnUser(tmp);
			if(PlayerInfo[playerid][pLeader] >= 1)
			{
			  if(IsPlayerConnected(para1))
			  {
			    if(para1 != INVALID_PLAYER_ID)
			    {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pLeader] = 0;
						PlayerInfo[para1][pMember] = 0;
						PlayerInfo[para1][pRank] = 0;
						PlayerInfo[para1][pChar] = 101;
						SetPlayerSkin(para1, 101);
						gTeam[para1] = 10;
						PlayerInfo[para1][pTeam] = 10;
						format(string, sizeof(string), "You have been kicked from the faction by leader %s.", sendername);
						SendClientMessage(para1, COLOR_LIGHTYELLOW, string);
						format(string, sizeof(string), "You have kicked %s from the faction.", giveplayer);
						SendClientMessage(playerid, COLOR_LIGHTYELLOW, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "	You are not authorized to use that command.");
			}
		}
		return 1;
	}
It also happends to the /invite command, but not so often, take a look at the /uninvite, if you cant find any problems there, I will show you the /invite command.

Thanks

Reply
#2

Probably because you have it setting their skin, if they're moving while it sets their skin, they will become frozen.
Reply
#3

Quote:
Originally Posted by Sky4D
Probably because you have it setting their skin, if they're moving while it sets their skin, they will become frozen.
Any way to fix that?

Reply
#4

pawn Код:
SetPlayerSkin(para1, 101);
Delete that.
Reply
#5

Quote:
Originally Posted by ikarus❶❸❸❼
pawn Код:
SetPlayerSkin(para1, 101);
Delete that.
Then the command dont understand what to do, it sets the teams right, but the skin will not change.
Reply
#6

Код:
if(strcmp(cmd, "/uninvite", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
 			if(IsLogged[playerid] == 0)
  		{
   			SendClientMessage(playerid, COLOR_GREY, "	You are not logged in yet.");
    			return 1;
   		}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "	USAGE: /uninvite [playerid]");
				return 1;
			}
			new para1;
			para1 = ReturnUser(tmp);
			if(PlayerInfo[playerid][pLeader] >= 1)
			{
			  if(IsPlayerConnected(para1))
			  {
			    if(para1 != INVALID_PLAYER_ID)
			    {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pLeader] = 0;
						PlayerInfo[para1][pMember] = 0;
						PlayerInfo[para1][pRank] = 0;
						PlayerInfo[para1][pChar] = 101;
						SetPlayerSkin(para1, 101);
						gTeam[para1] = 10;
						PlayerInfo[para1][pTeam] = 10;
						format(string, sizeof(string), "You have been kicked from the faction by leader %s.", sendername);
						SendClientMessage(para1, COLOR_LIGHTYELLOW, string);
						format(string, sizeof(string), "You have kicked %s from the faction.", giveplayer);
						SendClientMessage(playerid, COLOR_LIGHTYELLOW, string);
                        ToggleControllAble(para1, 1);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "	You are not authorized to use that command.");
			}
		}
		return 1;
	}
Reply
#7

Like Picharelo did, just add
Код:
ToggleControllable(para1, 1);
to 1 in the end of the

Код:
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pLeader] = 0;
						PlayerInfo[para1][pMember] = 0;
						PlayerInfo[para1][pRank] = 0;
						PlayerInfo[para1][pChar] = 101;
						SetPlayerSkin(para1, 101);
						gTeam[para1] = 10;
						PlayerInfo[para1][pTeam] = 10;
						format(string, sizeof(string), "You have been kicked from the faction by leader %s.", sendername);
						SendClientMessage(para1, COLOR_LIGHTYELLOW, string);
						format(string, sizeof(string), "You have kicked %s from the faction.", giveplayer);
						SendClientMessage(playerid, COLOR_LIGHTYELLOW, string);
Reply
#8

If a player jumps or moves while you are changing his / her skin, he will become frozen. There ain't anything what should freeze the player. Just delete "SetPlayerSkin(blalblll);"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)