How to make this
#1

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?
Reply
#2

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
Reply
#3

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
Reply
#4

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...
Reply
#5

Well, i only wanted to mark the spot, and that can be done with AddStaticPickup i guess?
Reply
#6

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...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)