Create Gametextfor player if hes near a door
#1

Hey guys i want to create a gametext for player if hes at a door but i couldnt find out how.. so i would like to get help from here

Thanks
Reply
#2

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

x, y, z are the coordinates near the door and the range you want.
Reply
#3

okay but where should i add it under? as i cant put it under CMD bcz then it only shows me when i write the Command..
Reply
#4

If you want it to check if the player is near the door all the time, then a timer or OnPlayerUpdate. Although using dynamic zone with streamer near the door will call OnPlayerEnterDynamicArea callback so checking if the areaid is the one zone for the door, you can then display the game text.
Reply
#5

alright thanks
Reply
#6

delete
Reply
#7

In the else, you open a bracket but you never close it. But since it's just a function, no need for brackets.

pawn Код:
CMD:halockers(playeridm params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1601.8799,-2547.0332,-24.4324))
    {
        ShowPlayerDialog(playerid,723,DIALOG_STYLE_LIST,"Hitman Agency Lockers","Knife\nDeagle\nSniper Rifle","Close","");
    }
    else SendClientMessage(playerid,COLOR_GREEN,"You are not near Hitman Agency Lockers!");
    return 1;
}

CMD:exitha(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 1.0, 1592.96375 -2553.85034 -24.52250))
    {
        SetPlayerPos(playerid,3375.4758,-993.0410,7.7766,2.0);
    }
    else SendClientMessage(playerid,COLOR_GREEN,"You are not near Hitman Agency Door!");
    return 1;
}
CMD:enterha(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 1.0, 3375.4758,-993.0410,7.7766))
    {
        GameTextForPlayer(playerid, "Welcome to Hitman Agency!", 5000, 2);
        SetPlayerPos(playerid,1592.96375,-2553.85034,-24.52250,2.0);
    }
    else SendClientMessage(playerid,COLOR_GREEN,"You are not near Hitman Agency Door!");
    return 1;
}
Reply
#8

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)