Please help with script
#2

PHP код:
new player1tmp[256], playername[MAX_PLAYER_NAME];
new 
count 0;
tmp strtok(cmdtextidx);
if(
IsNumeric(tmp))
{
        for(new 
0MAX_PLAYERSi++)
        {
                if(
IsPlayerConnected(i))
                        if(
strval(tmp) == i)
                                
player1 i;
                        else
                        {
                                
SendClientMessage(playeridCOLOR_WHITE"Error: Player not connected.");
                                
player1 INVALID_PLAYER_ID;
                        }
        }
}
else
{
        for(new 
0MAX_PLAYERSi++)
        {
                
GetPlayerName(iplayernamesizeof(playername));
                if(
IsPlayerConnected(i))
                        if(
strfind(playernametmptrue) != -1)
                                
count++;
        }
        if(
count == 0)
        {
                
SendClientMessage(playeridCOLOR_WHITE"Error: Player not connected.");
                
player1 INVALID_PLAYER_ID;
        }
        else
        {
                if(
count 7)
                {
                        
SendClientMessage(playeridCOLOR_WHITE"Error: Too many players matched your searched.");
                        
player1 INVALID_PLAYER_ID;
                }
                else if(
count == 1)
                {
                        for(new 
0MAX_PLAYERSj++)
                        {
                                if(
IsPlayerConnected(j))
                                {
                                        
GetPlayerName(jplayernamesizeof(playername));
                                        if(
strfind(playernametmptrue) != -1)
                                                
player1 j;
                                }
                        }
                }
                else if(
count <= 7)
                {
                        for(new 
0MAX_PLAYERSj++)
                        {
                                if(
IsPlayerConnected(j))
                                {
                                        
GetPlayerName(jplayernamesizeof(playername));
                                        if(
strfind(playernametmptrue) != -1)
                                        {
                                                
format(string,sizeof(string),"%s (%d)"playernamej);
                                                
SendClientMessage(playeridCOLOR_WHITEstring);
                                                
player1 INVALID_PLAYER_ID;
                                                continue;
                                        }
                                }
                        }
                        
SendClientMessage(playeridCOLOR_WHITE"Error: More than one player found. Choose one of the IDs above.");
                }
        }

Sorry, forgot about PHP Code.
Reply


Messages In This Thread
Please help with script - by AkaSKY - 16.08.2015, 12:02
Re: Please help with script - by AkaSKY - 16.08.2015, 12:14
Re: Please help with script - by AkaSKY - 16.08.2015, 13:48

Forum Jump:


Users browsing this thread: 2 Guest(s)