How do i make gate open and close? Please help me with this small thing
#9

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
This?
Код:
new GateObj;

public OnGameModeInit()
{
	GateObj = CreateDynamicObject(988, -488.89850, -562.67981, 25.35821,   0.00000, 0.00000, 0.00000);
	SetTimer("Gate", 500, true);
	
	return 1;
}

forward Gate();
public Gate()
{
	for(new i = 0; i < MAX_PLAYERS; i ++)
	{
		if(!IsPlayerConnected(i)) continue;
		
		if(IsPlayerInRangeOfPoint(i, 7.0, 488.89850, -562.67981, 25.35821))
		{
			new Name[24];
			GetPlayerName(i, Name, 24);
			
			if(strfind(Name, "[BD]", true) != -1) MoveObject(GateObj, -488.89850, -562.67981, 35.35821, 5.0, 0.0, 0.0, 0.0);
		}
		else MoveObject(GateObj, -488.89850, -562.67981, 25.35821, 5.0, 0.0, 0.0, 0.0);
	}
	return 1;
}
It's not working, the gate isn't opening at all..

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
PHP код:
new BDgate;
new 
GateOpen;
public 
OnGameModeInit()
{
    
BDgate CreateDynamicObject(988, -488.89850, -562.6798125.35821,   0.000000.000000.00000);
    
GateOpen 0;
    
SetTimer("BDGateCheck",3000,true);
    return 
1;
}
forward BDGateCheck();
public 
BDGateCheck()
{
    for(new 
i=0i<GetPlayerPoolSize(); i++)
    {
        if(
IsPlayerInRangeOfPoint(i,3.0,-488.89850, -562.6798125.35821) && strcmp(GetName(i), "[BD]"true4))
        {
         if(
GateOpen 0
          {
            
MoveDynamicObject(BDgate, -488.89850, -562.67981263.0Float:rx = -1000.0Float:ry = -1000.0Float:rz = -1000.0);
            
GateOpen 1;
          }
        }
        else if(
GateOpen 1)
        {
           
MoveDynamicObject(BDgate, -488.89850, -562.6798125.358213.0Float:rx = -1000.0Float:ry = -1000.0Float:rz = -1000.0);
           
GateOpen 0:
        }
    }
}
GetName(playerid)
{
  new 
Name[MAX_PLAYER_NAME];
  
GetPlayerName(playerid,Namesizeof(name));
  return 
Name;

It gives these errors:
Код:
(17) : error 017: undefined symbol "GetPlayerPoolSize"
(21) : warning 211: possibly unintended assignment
(23) : error 017: undefined symbol "rx"
(23) : warning 215: expression has no effect
(23) : error 017: undefined symbol "rz"
(23) : warning 215: expression has no effect
(23) : error 001: expected token: ";", but found ")"
(23) : fatal error 107: too many error messages on one line
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)