local OOC
#1

Hello, I am creating a RP server and it's going great! But today i noticed that I need local OOC too. The command should be /b i think.. So can you guys tell me how to make it, because i don't understand that part with getdistancebetweenplayers. So please tell me how to make that command. Thanks

Reply
#2

pawn Код:
if(!strcmp(cmdtext, "/b", true))
{
    for(new i=0; i<MAX_PLAYERS; i++) //Gettting all players in the variable i
    {
        if(GetDistanceBetweenPlayers(playerid, i) <= 20) //Correct me if there are more arguments in Getdistance...
        {
            if(cmdtext[2] == 32 || cmdtext[3] != EOS) //if there is a space and end of string isn't right after the space
            {
                new str[128];
                format(str, 128, "%s: %s", Name(playerid), cmdtext[3]);
                SendClientMessage(i, COLOR_WHITE, str); //Send message to all players nearby
            }
        }
    }
    return true;
}
pawn Код:
//place this on bottom of script
Name(i)
{
    new n[24];
    GetPlayerName(i, n, 24);
    return n;
}
That should work
Reply
#3

thanks man.You helped alot :P
Reply
#4

This code would never come in my script, its total ineffective coded :S
Reply
#5

I know, I just made it quick
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)