cmd:changeplayername
#3

try this i just took it from my script but it should work
PHP код:
if(strcmp(cmd"/changename"true) == 0)
    {
        
GetPlayerName(playeridsendernamesizeof(sendername));
        new 
tmpp[256];
        
tmpp strtok(cmdtextidx);
        if(!
strlen(tmpp))
        {
            
SendClientMessage(playeridCOLOR_DBLUE"Correct SYNTAX: /changename [playerid] [new nick]");
            return 
1;
        }
        
giveplayerid strval(tmpp);
        
tmp strtok(cmdtextidx);
        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(
IsPlayerConnected(giveplayerid))
                {
                    
SetPlayerName(giveplayeridtmp);
                    
format(stringsizeof(string), "AdmCMD: %s(%i) you changed the name to %s"sendernameplayeridtmp);
                    
SendClientMessage(giveplayeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), "("COL_RED"C.Life{FFFFFF}!) You have changed ID %i's name to %s"giveplayeridtmp);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(string256"("COL_RED"C.Life{FFFFFF}!) "COL_RED"%s {FFFFFF}je promjenuo ime "COL_RED"%s{FFFFFF}-a u "COL_RED"%s."sendername,giveplayertmp);
                    
ABroadCast(WHITE,string,1);
                }
                else
                {
                    
format(stringsizeof(string), "%d nije aktivan igrac."giveplayerid);
                    
SendClientMessage(playeridCOLOR_REDstring);
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"Nemate dozovolu za koristenje te komande!");
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_RED"Morate se prijaviti da biste koristili tu komandu!");
        }
          return 
1;
    } 
Reply


Messages In This Thread
cmd:changeplayername - by KillerStrike23 - 14.05.2014, 19:54
Re: cmd:changeplayername - by KillerStrike23 - 19.05.2014, 19:15
Re: cmd:changeplayername - by sl!x - 19.05.2014, 19:20
Re: cmd:changeplayername - by KillerStrike23 - 19.05.2014, 19:28
Re : cmd:changeplayername - by yusei - 19.05.2014, 19:31
Re: cmd:changeplayername - by KillerStrike23 - 19.05.2014, 19:49

Forum Jump:


Users browsing this thread: 2 Guest(s)