SA-MP Forums Archive
A little 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: A little help. (/showthread.php?tid=89923)



A little help. - BP13 - 05.08.2009

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SUBMISSION)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerInArea(playerid, 1153.0000, 1307.5000, -2107.5000, -2003.5000) == 1)
{
SendClientMessage(playerid,COLOR_RED,"You are not allawed to repair your vehicle in /BloodringArena.");
}
else
{
SetVehicleHealth(GetPlayerVehicleID(playerid),1000 .0);
SendClientMessage(playerid,COLOR_BASIC,"Your vehicle has been fixed.");
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
}
}
return 1;
}

IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}

if(IsPlayerInArea(playerid, 1153.0000, 1307.5000, -2107.5000, -2003.5000) == 1)


how does this work I thought it would be X,Y,Z but there is 4 spots so I'm not sure how this works.


Re: A little help. - agusfn20 - 05.08.2009

Float:minx, Float:maxx, Float:miny, Float:maxy

Itґs like player boundries


Re: A little help. - ruarai - 05.08.2009

Look for Seifs IsPlayerInArea Generator or just use PlayerToPoint