OnPlayerUpdate(playerid) -
AnonScripter - 07.11.2013
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;
}
Re: OnPlayerUpdate(playerid) -
Jefff - 07.11.2013
Use timer, is better for this but best way is OnPlayerEnterDynamicArea(playerid, areaid) streamer plugin
Re: OnPlayerUpdate(playerid) -
ReV. - 07.11.2013
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;
}
Re: OnPlayerUpdate(playerid) -
AnonScripter - 07.11.2013
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.
Re: OnPlayerUpdate(playerid) -
HardRock - 08.11.2013
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", 2500, 1);
}
}
return 1;
}
Re: OnPlayerUpdate(playerid) -
AnonScripter - 08.11.2013
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", 2500, 1);
}
}
return 1;
}
|
this will cause the same problem of SendClientMessage.
btw everything is fixed, thanks all
Re: OnPlayerUpdate(playerid) -
Pottus - 08.11.2013
Just use dynamic areas OPU makes no sense for this.