28.05.2016, 17:07
(
Последний раз редактировалось Darkwood17; 28.05.2016 в 17:57.
)
Quote:
It's not working, the gate isn't opening at all..
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 |
Both codes above by F1N4L and xTURBOx are incorrectly written and wrong.
You don't need to set the last 3 parameters (rx, ry, rx) because they have default value:
Код:
MoveDynamicObject(BDgate, -488.89850, -562.67981, 26, 3.0); MoveDynamicObject(BDgate, -488.89850, -562.67981, 25.35821, 3.0);
Код:
if (GateOpen == 0)
And you actually don't need to loop through all players. Just create the timer under OnPlayerSpawn or OnPlayerConnect.
This is how your code should look like:
Код:
// at the top of your script new BDgate; public OnGameModeInit() { BDgate = CreateDynamicObject(988, -488.89850, -562.67981, 25.35821, 0.00000, 0.00000, 0.00000); return 1; } public OnPlayerSpawn(playerid) { SetTimer("BDGateCheck", 500, true); return 1; } forward BDGateCheck(playerid); public BDGateCheck(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(IsPlayerInRangeOfPoint(i, 5.0, -488.89850, -562.67981, 25.35821) && strcmp(name, "[BD]", true, 4)) MoveDynamicObject(BDgate, -488.89850, -562.67981, 20, 3.0); // Open the gate else MoveDynamicObject(BDgate, -488.89850, -562.67981, 25.35821, 3.0); // Close the gate return 1; }