How to make this - 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: How to make this (
/showthread.php?tid=79418)
How to make this -
TehNobody - 28.05.2009
I want to make a marked spot (Marked with an ! or something) in my server, wich is the only place to execute the command, but how?
Re: How to make this -
Gozerr - 28.05.2009
Under OnPlayerCommandText:
pawn Код:
if (strcmp("/yourcommand", cmdtext, true) == 0)
{
if(PlayerToPoint(RADIUS, playerid, X, Y, Z))
{
// Do the thing that should be done
}
else
{
// Here if player aint on market
}
return 1;
}
End of code:
pawn Код:
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
{
new Float:oldpos[3], Float:temppos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
temppos[0] = (oldpos[0] -X);
temppos[1] = (oldpos[1] -Y);
temppos[2] = (oldpos[2] -Z);
if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
{
return true;
}
return false;
}
In the first code, replace RADIUS, X, Y and Z
Re: How to make this -
TehNobody - 28.05.2009
doesnt need PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
to be "public PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)" ? because i have it like tht already
Re: How to make this -
lol2112 - 28.05.2009
If you want it to be marked then you might want to use CreateCheckpoint and then only allow the command to process if the player is in the checkpoint...
Re: How to make this -
TehNobody - 28.05.2009
Well, i only wanted to mark the spot, and that can be done with AddStaticPickup i guess?
Re: How to make this -
lol2112 - 28.05.2009
Yeah you can do it with that as well and then tell your script to look to see if they're standing where the pickup is located...