Need help newb me
#2

pawn Код:
forward RunCheck(playerid);
new CheckTimer[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    CheckTimer[playerid] = SetTimerEx("RunCheck", 1000, 1, "i", playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(CheckTimer[playerid]);
    return 1;
}

public RunCheck(playerid)
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(i, X, Y, Z);
     
        if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z)) SendClientMessage(playerid, 0xF00000AA, "asylum is neaaaring yur postiion");
    }
    return 1;
}
It may lag your server because of the loop every second, and it will send message every one second if someone is in range of 5 meters to you.
Do the rest by yourself, this is just an idea.
Reply


Messages In This Thread
Need help newb me - by Asylum - 20.06.2010, 05:20
Re: Need help newb me - by Luka P. - 20.06.2010, 05:46
Re: Need help newb me - by Asylum - 20.06.2010, 05:50
Re: Need help newb me - by Antonio [G-RP] - 20.06.2010, 05:52
Re: Need help newb me - by Flashy - 20.06.2010, 06:32
Re: Need help newb me - by Asylum - 20.06.2010, 07:00

Forum Jump:


Users browsing this thread: 1 Guest(s)