public OnPlayerUpdate(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
// No weapons in interiors
if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
SetPlayerArmedWeapon(playerid,0); // fists
return 0; // no syncing until they change their weapon
}
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;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(IsPlayerInRangeOfPoint(playerid,110.0,-1489.6556, 751.8200, 7.2345))
{
SetPlayerHealth(playerid, 0.0);
}
return 1;
}
|
PHP код:
|
warning 235: public function lacks forward declaration (symbol "OnPlayerWeaponShot")
|
It's not working because you're not using 0.3z or above. You need to use 0.3z for that callback to work. Additionally, 110.0 is a VERY high range are you sure you want to use such a big radius?
|
|
This callback was added in SA-MP 0.3z and will not work in earlier versions!
|
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(IsPlayerInRangeOfPoint(playerid, 110.0,-1489.6556, 751.8200, 7.2345))
{
SetPlayerHealth(playerid, 0.0);
}
return true;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(IsPlayerInRangeOfPoint(playerid, 110.0,-1489.6556, 751.8200, 7.2345))
{
SetPlayerHealth(playerid, 0.0);
}
return true;
}
|
PHP код:
|
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(IsPlayerInRangeOfPoint(issuerid, 110.0,-1489.6556, 751.8200, 7.2345))
{
SetPlayerHealth(issuerid, 0.00);
SetPlayerArmour(issuerid, 0.00);
}
}
return true;
}
|
This callback was added in SA-MP 0.3d and will not work in earlier versions!
|
|
it work in samp 0.3z , but i want solution or method working in 0.3x like:
|
|
What You attempt with codes that allow previously ?.
This should work on any version. PHP код:
|