12.07.2009, 09:17
so when a player enters area -> ResetPlayerWeapons, when they leave from that area they get back their saved weapons..
here's an example of what I've been divulgin, but no work![angry](images/smilies/mad.gif)
when I entered area my weapons reseted, but I never got them back..
here's an example of what I've been divulgin, but no work
![angry](images/smilies/mad.gif)
when I entered area my weapons reseted, but I never got them back..
Код:
new SavedWeapons[MAX_PLAYERS][13]; new SavedAmmo[MAX_PLAYERS][13]; new bool: IsPlayerInZone[MAX_PLAYERS];
Код:
public OnPlayerConnect(playerid) { SetTimerEx("OnPlayerEnterArea",1000,1,"i",playerid); IsPlayerInZone[playerid] == false; }
Код:
forward OnPlayerEnterArea(playerid); public OnPlayerEnterArea(playerid) { if(IsPlayerInArea(playerid, minx, maxx, miny, maxy) && IsPlayerInZone[playerid] == false) for(new i; i<13; i++) { GetPlayerWeaponData(playerid, i, SavedWeapons[playerid][i], SavedAmmo[playerid][i]); } ResetPlayerWeapons(playerid); IsPlayerInZone[playerid] = true; }else if(!IsPlayerInArea(playerid, minx, maxx, miny, maxy) && IsPlayerInZone[playerid] == true) { for(new i; i<13; i++) { GivePlayerWeapon(playerid, SavedWeapons[playerid][i], SavedAmmo[playerid][i]); } IsPlayerInZone[playerid] = false; } }