New team command problem -.-
#1

SO using these codes

Код:
new TEAM_POLICE;

public OnPlayerSpawn(playerid)
{
	if(GetPlayerSkin(playerid) == 105) SetPlayerTeam(playerid, TEAM_GROVE);
 	 	if(GetPlayerSkin(playerid) == 106) SetPlayerTeam(playerid, TEAM_GROVE);
 	 	 	if(GetPlayerSkin(playerid) == 107) SetPlayerTeam(playerid, TEAM_GROVE);
 	if(GetPlayerSkin(playerid) == 102) SetPlayerTeam(playerid, TEAM_BALLAS);
 	 	if(GetPlayerSkin(playerid) == 103) SetPlayerTeam(playerid, TEAM_BALLAS);
 	 	 	if(GetPlayerSkin(playerid) == 104) SetPlayerTeam(playerid, TEAM_BALLAS);
 	if(GetPlayerSkin(playerid) == 280) SetPlayerTeam(playerid, TEAM_POLICE);
 	 	if(GetPlayerSkin(playerid) == 281) SetPlayerTeam(playerid, TEAM_POLICE);
            if(GetPlayerSkin(playerid) == 164) SetPlayerTeam(playerid, TEAM_POLICE);
				if(GetPlayerSkin(playerid) == 186) SetPlayerTeam(playerid, TEAM_POLICE);
				    if(GetPlayerSkin(playerid) == 283) SetPlayerTeam(playerid, TEAM_POLICE);
				        if(GetPlayerSkin(playerid) == 288) SetPlayerTeam(playerid, TEAM_POLICE);
				        	if(GetPlayerSkin(playerid) == 282) SetPlayerTeam(playerid, TEAM_POLICE);


	if (strcmp("/opdgate", cmdtext, true) == 0)
    {
        if(GetPlayerTeam(playerid) != TEAM_POLICE) return SendClientMessage(playerid, -1, "You can't use this as you are not in the police force.");
        if(IsPlayerInRangeOfPoint(playerid, 20, 1544.94104004,-1622.77990723,12.38281250))
    {
            MoveObject(gate, 1544.63146973,-1631.57128906,12.38281250, 4.00);
            SendClientMessage(playerid, 0xFF000000, "You have successfully opened the gate!");
    }
        return 1;
    }

    	if (strcmp("/cpdgate", cmdtext, true) == 0)
    {
        if(GetPlayerTeam(playerid) != TEAM_POLICE) return SendClientMessage(playerid, -1, "You can't use this as you are not in the police force.");
        if(IsPlayerInRangeOfPoint(playerid, 20, 1544.94104004,-1622.77990723,12.38281250))
    {
            MoveObject(gate, 1544.94104004,-1622.77990723,12.38281250, 4.00);
            SendClientMessage(playerid, 0xFF000000, "You have successfully closed the gate!");
    }
        return 1;
    }
I am STUMPED! It still lets people from TEAM_GROVE and TEAM_BALLAS open it.
Reply
#2

PHP код:
if(GetPlayerTeam(playerid) == 1
Not sure, but, Replace the "1" with the Team Number and not TEAM_POLICE
Reply
#3

Now it doesn't let any of them open it.
Code
Код:
 	if (strcmp("/opdgate", cmdtext, true) == 0)
    {
        if(GetPlayerTeam(playerid) == 0) return SendClientMessage(playerid, -1, "You can't use this as you are not a part of LAE");
        if(IsPlayerInRangeOfPoint(playerid, 20, 1544.94104004,-1622.77990723,12.38281250))
    {
            MoveObject(gate, 1544.63146973,-1631.57128906,12.38281250, 4.00);
            SendClientMessage(playerid, 0xFF000000, "You have successfully opened the gate!");
    }
        return 1;
    }
What's wrong?
Reply
#4

Quote:
Originally Posted by Rabbayazza
Посмотреть сообщение
Now it doesn't let any of them open it.
Code
Код:
 	if (strcmp("/opdgate", cmdtext, true) == 0)
    {
        if(GetPlayerTeam(playerid) == 0) return SendClientMessage(playerid, -1, "You can't use this as you are not a part of LAE");
        if(IsPlayerInRangeOfPoint(playerid, 20, 1544.94104004,-1622.77990723,12.38281250))
    {
            MoveObject(gate, 1544.63146973,-1631.57128906,12.38281250, 4.00);
            SendClientMessage(playerid, 0xFF000000, "You have successfully opened the gate!");
    }
        return 1;
    }
What's wrong?
Edit the TEAM_POLICE to TeamID 1 then Replace

PHP код:
 if(GetPlayerTeam(playerid) == 0
0 with 1.
Reply
#5

Thank you!!!!!!!!!
Reply
#6

Quote:
Originally Posted by Rabbayazza
Посмотреть сообщение
Thank you!!!!!!!!!
No Problem, mate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)