Countdown 300m within, outside
#1

Hello! I would like your help to ask a simple return preparation count command, so the command should be: if someone starts a countdown, only around see 300m within, who is not to see 300m I was outside but who's to 300 m of in addition you can also get the countdown started, I'd appreciate it if someone could create this for me. Sorry for the bad English for knowledge. Thanks in advance ^ ^
Reply
#2

pawn Код:
new Float:x, Float:y, Float:z;
if(IsPlayerInRangeOfPoint(playerid,300,x,y,z)) {
Sry on phone,if error that argument that doesnt shit, just research it on samp wiki
Reply
#3

Example:
pawn Код:
CMD:countdown(playerid, params[])
{
    new str[60], name[MAX_PLAYER_NAME], Float:x, Float:y, Float:z;
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerPos(playerid, x, y, z);
    format(str, sizeof(str), "%s(%d) has started a countdown.", name, playerid);
    for(new i = 0; i < MAX_PLAYERS; i++) //foreach is a better option
    {
        if(!IsPlayerConnected(i)) continue;
        if(!IsPlayerInRangeOfPoint(i, 300.0, x, y, z)) continue;
        SendClientMessage(i, 0xFFFF00FF, str);
        //Player is within 300 units of playerid.
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)