[Help] Unjail
#1

Hi guys
Trying to make a /unjail command for the Police it works fine well but everyone can use it even tho i setted it to only faction 1 (Police)
thanks.

Код:
if(strcmp(cmd, "/unjail",true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
	        {

	        }
	        tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unjail [playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					SendClientMessage(giveplayerid, COLOR_BLUE, string);
					SetPlayerPos(giveplayerid, 1551.0023,-1675.6843,15.6575);
					format(string, 256, "[Police] %s has been un-prisoned by Officer %s.", giveplayer, sendername);
					ABroadCast(COLOR_BLUE,string,1);
				}
			}
	    }
	    return 1;
	}
Reply
#2

pawn Код:
if(strcmp(cmd, "/unjail",true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unjail [playerid/PartOfName]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, 256, "[Police] %s has been un-prisoned by Officer %s.", giveplayer, sendername);
                        ABroadCast(COLOR_BLUE,string,1);
                        SetPlayerPos(giveplayerid, 1551.0023,-1675.6843,15.6575);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not a cop !");
            }
        }
        return 1;
    }
Try this
Reply
#3

pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
Should be

pawn Код:
if((PlayerInfo[playerid][pMember] == 1) || (PlayerInfo[playerid][pLeader] == 1))
Reply
#4

Thanks alot guys.
good with some other eyes
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)