AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   string functions (https://forums.alliedmods.net/showthread.php?t=64202)

vl4dik 12-10-2007 13:46

string functions
 
hi, what i need to include and what functions can i use for string comparsion,
can somebody post a snipet for:
"for every player, if in his nick somewhere is `XYZ` do this"

M249-M4A1 12-10-2007 15:25

Re: string functions
 
PHP Code:

public cmdCheckNames(id) {
    new 
players[32], name[32], totalplayers
    get_players
(playerstotalplayers)
    
    for (new 
0totalplayersi++) {
        
get_user_name(players[i], name31)
        
        if (
containi(name"`XYZ`") != -1)
            
console_print(id"[AMXX] Player name '%s' contains `XYZ`"name)
        
    }




All times are GMT -4. The time now is 11:00.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.