21.10.2009, 13:26
I Made a gate but it wont open,here are the lines...
And this:
And this:
So whats wrong,why it wont open,im using samp 0.3
Код:
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z) { new Float:oldpos[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; } public CheckGate() { for(new i = 0; i < GetMaxPlayers(); i++) { if(!IsPlayerConnected(i)) continue; if(PlayerToPoint(10.0, i, 213.880005, 1875.686768, 10.506058) && OpenGate[i] == 0) { MoveObject(c_gate, 213.882446, 1875.694214, 14.031004,5); OpenGate[i] = 1; } else if(!PlayerToPoint(10.0,i, 213.880005, 1875.686768, 10.506058) && OpenGate[i] == 1) { OpenGate[i] = 0; } } }
Код:
new c_gate; new OpenGate[MAX_PLAYERS]; forward CheckGate();
Код:
c_gate=CreateObject(11327, 213.882446, 1875.694214, 14.031004, 0.000000, 0.000000, 270.000001124); //