29.11.2010, 13:25
How to detect if there is more than 1 person in a gang zone ?
#include <VUF>
public OnPlayerStateChange(playerid, newstate, oldstate) { new count = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerInPlace(playerid, Float:X_min, Float:X_max, Float:y_min, Float:y_max, Float:z_max, Float:z_min)) count++; return 1; }
native CreateDynamicRectangle(Float:minx, Float:miny, Float:maxx, Float:maxy, worldid = -1, interiorid = -1, playerid = -1);
native IsPlayerInDynamicArea(playerid, areaid);
Код:
#include <VUF> Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { new count = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerInPlace(playerid, Float:X_min, Float:X_max, Float:y_min, Float:y_max, Float:z_max, Float:z_min)) count++; return 1; } |