OnPlayerUpdate(playerid)
#1

somebody please tell me how to fix this, it keeps sending the message and not stop if i'm in range of the point.
i want to make it sends the message 1 time, not 1000 times -.-
and do i put it in the correct callback ?

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,4.0,1023.9600,2111.4851,10.8203))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            SendClientMessage(playerid,COLOR_WHITE,"Type /mission to start");
        }
    }
    return 1;
}
Reply
#2

Use timer, is better for this but best way is OnPlayerEnterDynamicArea(playerid, areaid) streamer plugin
Reply
#3

PHP код:
public OnPlayerUpdate(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,4.0,1023.9600,2111.4851,10.8203))
    {
        if(!
GetPVarInt(playerid"messageSent"))
        {
             if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
             {
                     
SendClientMessage(playerid,COLOR_WHITE,"Type /mission to start");
                     
SetPVarInt(playerid"messageSent"1);
             }
        }
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by Jefff
Посмотреть сообщение
Use timer, is better for this but best way is OnPlayerEnterDynamicArea(playerid, areaid) streamer plugin
i will try OnPlayerEnterDynamicArea

Quote:
Originally Posted by ReV.
Посмотреть сообщение
PHP код:
public OnPlayerUpdate(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,4.0,1023.9600,2111.4851,10.8203))
    {
        if(!
GetPVarInt(playerid"messageSent"))
        {
             if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
             {
                     
SendClientMessage(playerid,COLOR_WHITE,"Type /mission to start");
                     
SetPVarInt(playerid"messageSent"1);
             }
        }
    }
    return 
1;

i think think this will cause of another problem, when a player leave the range of point and get to the point again, it won't send the message.
Reply
#5

You can do it with textdraw or:

PHP код:
public OnPlayerUpdate(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,4.0,1023.9600,2111.4851,10.8203))
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            
GameTextForPlayer(playerid"Type /mission to start"25001);
        }
    }
    return 
1;

Reply
#6

Quote:
Originally Posted by HardRock
Посмотреть сообщение
You can do it with textdraw or:

PHP код:
public OnPlayerUpdate(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,4.0,1023.9600,2111.4851,10.8203))
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            
GameTextForPlayer(playerid"Type /mission to start"25001);
        }
    }
    return 
1;

this will cause the same problem of SendClientMessage.
btw everything is fixed, thanks all
Reply
#7

Just use dynamic areas OPU makes no sense for this.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)