Chat Commands
#8

PHP код:
    if(!strcmp("/do"cmdtexttrue))
    {
        
// Create array...
        
static
            
str[128]
        ;
        
        
// Format Array "str"
        
if(sscanf(cmdtext,"s[128]",str))
            return 
SendClientMessage(playerid,-1,"USAGE: /do [TEXT]");
            

        
// Create Array to get name of player
        
static
            
name[24// MaxPlayer name is 24!
        
;

        
// Formating message
        
format(str,sizeof(str),"** %s ((%s))",str,(GetPlayerName(playerid,name,20), name));
        
        
        
// Create floats.
        
static
            
Float:X,
            
Float:Y,
            
Float:Z
        
;
        
        
// Store Player pos in floats createds.
        
GetPlayerPos(playerid,X,Y,Z);
        
        
        
// Making loop(otimized).
        
        // Create variables to incremment and to store sever slots.
        
static
            
Interator,
            
MaxPlayer
        
;
        
        
// Reseting variables, after don't show errors.
        
Interator 0;
        
MaxPlayers GetMaxPlayers();
        
        
// Looopiing..
        
for(;  Interator != MaxPlayers; ++Interator)
        {
            
/// if's players near player exibe message.
            
if(IsPlayerInRangeOfPoint(Interator,5,X,Y,Z))
            {
                
SendClientMessage(Interator,-1,str);
            }
        }
        return 
1;
    } 
Sorry my english, i'm Brazilian boy.
Reply


Messages In This Thread
Chat Commands - by CrazyManiac - 11.10.2012, 18:18
Re: Chat Commands - by gtakillerIV - 11.10.2012, 18:26
Re: Chat Commands - by CrazyManiac - 11.10.2012, 18:46
Re: Chat Commands - by gtakillerIV - 11.10.2012, 18:54
Re: Chat Commands - by Riddick94 - 11.10.2012, 18:59
Re: Chat Commands - by CrazyManiac - 11.10.2012, 19:13
Re: Chat Commands - by Glint - 11.10.2012, 19:14
Re: Chat Commands - by zSuYaNw - 11.10.2012, 19:21
Re: Chat Commands - by ZeMuNaC - 11.10.2012, 20:17
Re: Chat Commands - by Riddick94 - 11.10.2012, 20:26

Forum Jump:


Users browsing this thread: 2 Guest(s)