Help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help (
/showthread.php?tid=247497)
Help -
marinov - 09.04.2011
under OnPlayerDeath
pawn Код:
if(pInfo[playerid][Team] == 2)
{
new Float:XZ;
new Float:YZ;
new Float:ZZ;
GetPlayerPos(playerid, XZ, YZ, ZZ);
{
DeathArea = GangZoneCreate(XZ-20, YZ-20, XZ+20, YZ+20);
}
GangZoneShowForAll(DeathArea, VIRUS_ZONE_COLOR);
}
then I need something like this on the timer
pawn Код:
if(IsPlayerInArea(i, XZ-20, XZ+20, YZ-20, YZ+20))//wont work, how should I do it ?
how will I put the coords ? That one won't work
Re: Help -
marinov - 11.04.2011
bump, plz help
Re: Help - Unknown123 - 12.04.2011
I think you have to use SetPVar
Example:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:XZ;
new Float:YZ;
new Float:ZZ;
GetPlayerPos(playerid, XZ, YZ, ZZ);
{
DeathArea = GangZoneCreate(XZ-20, YZ-20, XZ+20, YZ+20);
SetPVarFloat(playerid, "DeathAreaXZ_1", XZ-20);
SetPVarFloat(playerid, "DeathAreaYZ_1", YZ-20);
SetPVarFloat(playerid, "DeathAreaXZ_2", XZ+20);
SetPVarFloat(playerid, "DeathAreaXZ_2", YZ+20);
}
GangZoneShowForAll(DeathArea, VIRUS_ZONE_COLOR);
return 1;
}
pawn Код:
if(IsPlayerInArea(i, GetPVarFloat(playerid, "DeathAreaXZ_1"), GetPVarFloat(playerid, "DeathAreaYZ_1"), GetPVarFloat(playerid, "DeathAreaXZ_2"), GetPVarFloat(playerid, "DeathAreaYZ_2"))
It it worth a try =/
Re: Help -
marinov - 12.04.2011
would that work if I'm checking if there's ANY player on the area ? like using foreach
and I tested it didn't work
Re: Help -
Lorenc_ - 13.04.2011
Errm.
pawn Код:
GetPlayerPos(playerid, XZ, YZ, ZZ);
{
}
Error der!
pawn Код:
if(pInfo[playerid][Team] == 2)
{
new Float:XZ;
new Float:YZ;
new Float:ZZ;
GetPlayerPos(playerid, XZ, YZ, ZZ);
DeathArea = GangZoneCreate(XZ-20, YZ-20, XZ+20, YZ+20);
GangZoneShowForAll(DeathArea, VIRUS_ZONE_COLOR);
}
Brackets aren't necessary
Re: Help -
marinov - 13.04.2011
Quote:
Originally Posted by Lorenc_
Errm.
pawn Код:
GetPlayerPos(playerid, XZ, YZ, ZZ); { }
Error der!
pawn Код:
if(pInfo[playerid][Team] == 2) { new Float:XZ; new Float:YZ; new Float:ZZ; GetPlayerPos(playerid, XZ, YZ, ZZ); DeathArea = GangZoneCreate(XZ-20, YZ-20, XZ+20, YZ+20); GangZoneShowForAll(DeathArea, VIRUS_ZONE_COLOR); }
Brackets aren't necessary
|
Oh ok, I'll remove them. but do u know how to use IsPlayerInArea with that
Re: Help -
Lorenc_ - 14.04.2011
What do you mean
Re: Help -
marinov - 15.04.2011
Quote:
Originally Posted by Lorenc_
What do you mean
|
where a player dies it will create the gangzone (so far works) and then it will check if any other player get inside that gangzone, if it is in there he will lose health (I need a way to check if the player is in the gangzone)
Re: Help -
marinov - 18.04.2011
bump
Re: Help -
iJumbo - 18.04.2011
save all the pos
then make like
if( Pos[0] >= MINX && Pos[0] <= MAXX && Pos[1] >= MINY && Pos[1] <= MAXY )