26.03.2012, 10:09
Can you help this code:
Код:
forward CheckForWalking(); public OnGameModeInit(); { SetTimer("CheckForWalking", 1500, 1); } public CheckForWalking() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerToPoint(5.0, i, X ,Y, Z)) { if(GetPlayerColor(i) == 0xFFFFFF00) { Script for move gate. } else return 1; } } } return 1; } static PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z) { if(IsPlayerConnected(playerid)) { new Float:pos[3]; new Float:tmppos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); tmppos[0] = (pos[0] - x); tmppos[1] = (pos[1] - y); tmppos[2] = (pos[2] - z); if (((tmppos[0] < radi) && (tmppos[0] > -radi)) && ((tmppos[1] < radi) && (tmppos[1] > -radi)) && ((tmppos[2] < radi) && (tmppos[2] > -radi))) { return 1; } } return 0; }