IsPlayerInArea
#1

ok so i have the cords for isplayerinarea but i need help putting something so it removes the persons weapons and once there out gives them back. does any one know how to do this?


IsPlayerInArea(playerid, 2043.376098, 2036.753295, 1340.479736, 1331.431152)
2043.376098, 2036.753295, 1340.479736, 1331.431152

IsPlayerInArea(playerid, 2042.890991, 2036.907958, 1353.806518, 1345.685180)
2042.890991, 2036.907958, 1353.806518, 1345.685180

theres are the two cord's.. around the area i whant weapons to be removed but then giving back once there out of there
Reply
#2

Use GetPlayerWeaponData, ResetPlayerWeapons, and GivePlayerWeapon.
Reply
#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
#4

Quote:
Originally Posted by Jay_
Use GetPlayerWeaponData, ResetPlayerWeapons, and GivePlayerWeapon.
i cant seem to figure out how to works this :S sorry so if i have

IsPlayerInArea(playerid, 2043.376098, 2036.753295, 1340.479736, 1331.431152)
IsPlayerInArea(playerid, 2042.890991, 2036.907958, 1353.806518, 1345.685180)
ResetPlayerWeapons(playerid, etc.....)


but what do i use when there out of the area

Reply
#5

This is my admin Fs i've included it in there have a look, you'll need dini, dutils and dudb thou to complie it, i will give you 3 warnings

http://www.mediafire.com/?sharekey=0...5965eaa7bc68bc

pawn Код:
C:\Documents and Settings\Desktop\samp\filterscripts\RegServXA.pwn(76) : warning 235: public function lacks forward declaration (symbol "LoadWeapons")
C:\Documents and Settings\Desktop\samp\filterscripts\RegServXA.pwn(124) : warning 235: public function lacks forward declaration (symbol "InAreaCheck")
C:\Documents and Settings\Desktop\samp\filterscripts\RegServXA.pwn(152) : warning 235: public function lacks forward declaration (symbol "OutOfAreaCheck")
These are the parts you need to look at
Reply
#6

thanks!!!!!!!! ill try it
Reply
#7

I've got this exact thing you're talking about. I did it for a chill out safe zone and for a stint area so people couldn't use weapons in these areas and their weapons returned once they left the area.

I'll pm you with it when I get a chance.
Reply
#8

Quote:
Originally Posted by Outbreak
I've got this exact thing you're talking about. I did it for a chill out safe zone and for a stint area so people couldn't use weapons in these areas and their weapons returned once they left the area.

I'll pm you with it when I get a chance.
thanks so much this will be so great if u could help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)