#1

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

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

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

A checkpoint has the exact functionality you desire.
Reply
#5

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)