IsPlayerInArea
#3

this is how i save weapons using dubd

pawn Код:
public LoadWeapons(playerid) {
  for (new i = 0; i < 13; i++) {
    new tmp[10];
    valstr(tmp,i);
    new slot[10];
    format(slot,10,"weapslot%s",tmp);
    if (dUserINT(PlayerName(playerid)).(slot)!=0)
    {
      new ammo[10];
      format(ammo,10,"weapammo%s",tmp);
      GivePlayerWeapon(playerid,dUserINT(PlayerName(playerid)).(slot),dUserINT(PlayerName(playerid)).(ammo));
    }
  }
}

public OnPlayerDisconnect(playerid, reason)
{
    if(Registered[playerid])
    {
    dUserSetINT(PlayerName(playerid)).("Money",GetPlayerMoney(playerid));
    dUserSetINT(PlayerName(playerid)).("Kills",MyKills[playerid]);
    dUserSetINT(PlayerName(playerid)).("Deaths",MyDeaths[playerid]);
    dUserSetINT(PlayerName(playerid)).("Level",Level[playerid]);
    dUserSetINT(PlayerName(playerid)).("Wantedlvl",GetPlayerWantedLevel(playerid));
    dUserSetINT(PlayerName(playerid)).("LoggedIn",LoggedIn[playerid]=0);
    dUserSetINT(PlayerName(playerid)).("Registered",Registered[playerid]);
   
    new weapons[13][2];
    for (new i = 0; i < 13; i++)
    {
    GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
    if (weapons[i][0]!=0)
    {
      new tmp[10];
      valstr(tmp,i);
      new slot[10];
      format(slot,10,"weapslot%s",tmp);
      dUserSetINT(PlayerName(playerid)).(slot,weapons[i][0]);
      new ammo[10];
      format(ammo,10,"weapammo%s",tmp);
      dUserSetINT(PlayerName(playerid)).(ammo,weapons[i][1]);
            }
        }
       }
    return 1;
}

public OnPlayerSpawn(playerid)
{
SetTimer("LoadWeapons",2000,0);
    return 1;
}
This obviously gives the player their weapons back when they spawn but you can use the LoadWeapons function in a timer to and check to see if ppl are in the area
Reply


Messages In This Thread
IsPlayerInArea - by Barrio - 08.02.2009, 21:54
Re: IsPlayerInArea - by Grove - 08.02.2009, 22:05
Re: IsPlayerInArea - by SmartyPants - 08.02.2009, 22:18
Re: IsPlayerInArea - by Barrio - 08.02.2009, 22:25
Re: IsPlayerInArea - by SmartyPants - 08.02.2009, 22:48
Re: IsPlayerInArea - by Barrio - 08.02.2009, 23:39
Re: IsPlayerInArea - by Outbreak - 08.02.2009, 23:59
Re: IsPlayerInArea - by Barrio - 09.02.2009, 00:09

Forum Jump:


Users browsing this thread: 1 Guest(s)