No weapons in place - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: No weapons in place (
/showthread.php?tid=566654)
No weapons in place -
s3ek - 07.03.2015
if(IsPlayerInRangeOfPoint(playerid,110.0,-1489.6556, 751.8200, 7.2345))
take weapons (not in interiors) , pleas help me
Re: No weapons in place -
s3ek - 07.03.2015
code: pleas help me
PHP код:
if(IsPlayerInRangeOfPoint(playerid,110.0,-1489.6556, 751.8200, 7.2345))
{
if(!GetPVarInt(playerid,"spawn")) // we are looking if there as variable with the name 'spawn' present , which we havent created yet
{
SetPVarInt(playerid,"spawn",1); // since there wasnt , we now create it so that the loop doesnt enter this again n again and create 'lag'
PlayAudioStreamForPlayer(playerid,"http://somafm.com/tags.pls",-1489.6556, 751.8200, 7.2345,110.0,1);
}
}
else // player is not in point range
{
if(GetPVarInt(playerid,"spawn")) // since we create it before and played the stream , it will be there
{
DeletePVar(playerid,"spawn");// delete the variable so that next time player goes in range the radio can be started again
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}
Respuesta: No weapons in place -
JuanStone - 07.03.2015
I cannot understand, try to say that if a player enters a specific interior remove their weapons and change to the valid interior give their weapons ?.
PHP код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(newinterior != /*interior_valid*/)
{
// remove weapons
}
else if(newinterior == /*interior_valid*/)
{
// give weapons
}
return true;
}
Re: No weapons in place -
s3ek - 07.03.2015
I mean if player in RangeOfPoint(playerid,110.0,-1489.6556, 751.8200, 7.2345)) .... SetPlayerArmedWeapon(playerid,0);
Re: No weapons in place -
Finnick - 07.03.2015
You Mean If Player In RangeOfPoint Will Be Get Weapons? :/
Re: No weapons in place -
s3ek - 07.03.2015
Quote:
Originally Posted by Finnick
You Mean If Player In RangeOfPoint Will Be Get Weapons? :/
|
If Player In Range Of Point can't shoot
Re: No weapons in place -
Finnick - 07.03.2015
PHP код:
public OnPlayerUpdate(playerid)
{
SetPlayerArmedWeapon(playerid,0); // disables weapons
return 1;
}
PHP код:
new Weap[2];
GetPlayerWeaponData(playerid, 4, Weap[0], Weap[1]);
SetPlayerArmedWeapon(playerid, Weap[0]);
For More Information Check :
https://sampwiki.blast.hk/wiki/SetPlayerArmedWeapon