03.12.2009, 16:51
Quote:
new OpenGate[MAX_PLAYERS]; new c_gate; forward CheckGate(); main() PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z) { new Floatldpos[3], Float:temppos[3]; GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]); temppos[0] = (oldpos[0] -X); temppos[1] = (oldpos[1] -Y); temppos[2] = (oldpos[2] -Z); if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius))) { return true; } return false; } c_gate = CreateObject(16775, 2063.2603, -2600.1406, 16.5461, 0.0000, 0.0000, 33.5180, 500.0); public CheckGate() { for(new i = 0; i < GetMaxPlayers(); i++) { if(!IsPlayerConnected(i)) continue; if(PlayerToPoint(10.0, i, 2067.1909,-2605.8831,13.5469) && OpenGate[i] == 0) { MoveObject(c_gate, 2063.2507, -2600.1677, 8.5313); OpenGate[i] = 1; } else if(!PlayerToPoint(10.0, i, 2059.3821,-2594.8203,13.5469) && OpenGate[i] == 1) { MoveObject(c_gate, 2063.2603, -2600.1406, 16.5461); OpenGate[i] = 0; } } } public gate() { SetTimer("CheckGate", 500, true); } |
1 ERROR:
error 010: invalid function or declaration
What is problem??
please help i'm beginer!!!