dive = AddStaticPickup(1239, 2, 1763.684,-1486.484,453.757);
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == dive) GameTextForPlayer(playerid,"Jump out and dive!!",2500,6);
}
|
Originally Posted by Chuck_Taylor
Use the PlayerToPoint function and then make a timer that checks the players position.If he is in the spot he will show that text
|
if(PlayerToPoint(2.0,playerid,1763.684, -1486.484, 453.757))
{
GameTextForPlayer(playerid,"Jump out and dive!!",2500,6);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == dive) return GameTextForPlayer(playerid,"Jump out and dive!!",2500,6);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == dive) { GameTextForPlayer(playerid,"Jump out and dive!!",2500,6); }
}
|
Originally Posted by CueЯvo
pawn Код:
or pawn Код:
|
SetTimer( "PickupMessages", 1500, true );
forward PickupMessages();
public PickupMessages()
{
new Float: TX, Float: TY, Float: TZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerPos( i, TX, TY, TZ );
if( IsPlayerInRangeOfPoint( i, 5.0, 1763.684, -1486.484, 453.757 ) )
{
GameTextForPlayer( i, "Jump out and dive!", 2500, 6 );
}
}
return 1;
}
|
Originally Posted by PRANK
Use CreatePickup.. I think.
|
if(PlayerToPoint(3.0,playerid,x,y,z)) return SendClientMessage(playerid, COLOR_GREEN, "Jump out and dive!");
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);