SA-MP Forums Archive
HELLO - 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)
+--- Thread: HELLO (/showthread.php?tid=584870)



HELLO - Mariciuc223 - 08.08.2015

Hello, i have a little problem / question :

I have that :

Код HTML:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == ospu) GameTextForPlayer(playerid, "~g~~h~Faction Safe~n~~y~Type ~b~/opensafe~y~ to open~h~ faction safe !", 60*60*3600, 4);
	else GameTextForPlayer(playerid, " ", 1, 4);
	return 1;
}
It work how i want , but it dose not disappear when i exit from pickup , it disappear if i enter in other pickup . I tried with a timer but didn't make anything at all... My question it's how to make it to disappear when i exit from pickup. Is there any function like "OnPlayerExitPickup" or something I WILL thanks with a +REP for anyone who help me


Re: HELLO - Sjn - 08.08.2015

It won't work like that, either check if the player is in range of the pickup position under a timer or create a 3D text label at the position of that pickup to show the message. Or use a streamer plugin to create an area there then you can use OnPlayerEnterDynamicArea and OnPlayerLeaveDynamicArea callbacks.


Re: HELLO - Mariciuc223 - 08.08.2015

Ok , i will give a try tomorrow , today i'am so tired .. Another suggestions ?


Re: HELLO - Vince - 08.08.2015

A checkpoint has the exact functionality you desire.


Re: HELLO - Mariciuc223 - 09.08.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
A checkpoint has the exact functionality you desire.
Ok , you right ... But i can make that checkpoint invisible somehow ?


Re: HELLO - MarvinPWN - 09.08.2015

If you write it like this, it will work:
PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == ospu)
    {
        
GameTextForPlayer(playerid"~g~~h~Faction Safe~n~~y~Type ~b~/opensafe~y~ to open~h~ faction safe !"60*60*36004);
        
SetTimerEx("PlayerInCheckpoint",1000,1,"ii",playerid,pickupid);
    }
    return 
1;
}
forward PlayerInCheckpoint(playerid,pickupid);
public 
PlayerInCheckpoint(playerid,pickupid)
{
    if(
pickupid == 0)
    {
        if(!
IsPlayerInRangeOfPoint(playerid,1.0,xyz))GameTextForPlayer(playerid," ",0,4);
    }
    return 
1;

I have test it and it work perfectly.

(xyz => coordination)


Re: HELLO - Mariciuc223 - 09.08.2015

Quote:
Originally Posted by MarvinPWN
Посмотреть сообщение
If you write it like this, it will work:
PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == ospu)
    {
        
GameTextForPlayer(playerid"~g~~h~Faction Safe~n~~y~Type ~b~/opensafe~y~ to open~h~ faction safe !"60*60*36004);
        
SetTimerEx("PlayerInCheckpoint",1000,1,"ii",playerid,pickupid);
    }
    return 
1;
}
forward PlayerInCheckpoint(playerid,pickupid);
public 
PlayerInCheckpoint(playerid,pickupid)
{
    if(
pickupid == 0)
    {
        if(!
IsPlayerInRangeOfPoint(playerid,1.0,xyz))GameTextForPlayer(playerid," ",0,4);
    }
    return 
1;

I have test it and it work perfectly.

(xyz => coordination)
Don't work ... What the .., whyyyy

EDIT AGAIN: I change from pickupid == 0 to pickupid == ospu and it worked , and it's working so "gud"
I can't give u +rep because i need to spend some reputation around -_-