Help gate TDM
#1

Good, I have a small doubt, I hope they guide me to solve my problem.


I have a gate that opens for a Key, but I want that gate to be opened only by the TEAM GROOVE, that the others can not.


Код:
new idEquipo[MAX_PLAYERS]; 
#define Ballas 0
#define Groove 1
#define Astecaz 2
#define Militares 3
#define Vagos 4
#define Policia 5
#define Mafia 6
#define Motoqueros 7

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(pressed(KEY_ANALOG_RIGHT)) 
{
    if(IsPlayerInRangeOfPoint(playerid,30, 2496.386,-1742.320,15.883)) 
    {

        MoveObject(Puerta,2496.386,-1742.320,5.883, 8.0);
        SetTimer("CerrarPuerta", 7000, true); 
    }
}
	return 1;
}

forward CerrarPuerta(playerid);
public CerrarPuerta(playerid)
{
	  MoveObject(Puerta,2496.386,-1742.320,15.883,2.0); 
	  return 1;
}
Reply
#2

Simply use GetPlayerTeam().


PHP код:
if(pressed(KEY_ANALOG_RIGHT)) 
{
    if(
IsPlayerInRangeOfPoint(playerid,302496.386,-1742.320,15.883)) 
    {
        if(
GetPlayerTeam(playerid) == Groove)
        {
             
MoveObject(Puerta,2496.386,-1742.320,5.8838.0);
             
SetTimer("CerrarPuerta"7000true); 
        }
    }

Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Simply use GetPlayerTeam().


PHP код:
if(pressed(KEY_ANALOG_RIGHT)) 
{
    if(
IsPlayerInRangeOfPoint(playerid,302496.386,-1742.320,15.883)) 
    {
        if(
GetPlayerTeam(playerid) == Groove)
        {
             
MoveObject(Puerta,2496.386,-1742.320,5.8838.0);
             
SetTimer("CerrarPuerta"7000true); 
        }
    }

Thanks for your help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)