06.07.2009, 19:24
i have this bit of code :
the problem is: i dont get a parachute whilst im in air and the messages dont appear at all.. so please if you could help me , and explain allitle more on how to exactly do this
Код:
public FallingChecker() { new Float:x,Float:y,Float:z,Float:d; for(new i =0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { GetPlayerPos(i,x,y,z); d = floatsqroot((x-LastX[i] * x-LastX[i]) + (y-LastY[i] * y-LastY[i])); if(d < 10 && (LastZ[i] - z) > 5) { OnPlayerFall(i); } LastX[i] = x; LastY[i] = y; LastZ[i] = z; } } return 1; } public OnPlayerFall(playerid) { SendClientMessage(playerid,0x000000FF,"You are falling! A parachute has been equipped."); SendClientMessage(playerid,0x000000FF,"Open your parachute NOW!!!"); GivePlayerWeapon(playerid,46,1); return 1; }