help guyz setname
#1

PHP код:
CMD:setname(playeridparams[])
{
    new 
targetid,aname[128];
    if(
Player[playerid][pAdmin] < || !IsPlayerAdmin(playerid)) return 0;
    else if (
sscanf(params,"us",targetid,aname))SendClientMessage(playerid,COLOR_ORANGE,"Usage: /setname [Playerid] [New name]");
    else if(!
IsPlayerConnected(targetid))SendClientMessage(playerid,COLOR_ORANGE,"Error: Player is not connected!");
    else {
        new 
string[128],n[MAX_PLAYER_NAME];
        
GetPlayerName(targetid,n,sizeof(n));
        
SetPlayerName(targetid,aname);
        
format(string,sizeof(string),"Admin %s [ID:%d] Has set %s [ID:%d] name to %s",GetName(playerid),playerid,n,targetid,aname);
        
SendClientMessageToAll(COLOR_ORANGE,string);
          
format(string,sizeof(string),"Your Name has been set to %s by Admin %s[ID:%d]",aname,n,playerid);
        
SendClientMessage(playerid,COLOR_ORANGE,string);
        
SetTimer("setname",9000,0);
    }
    return 
1;
}
forward setname(targetid);
public 
setname(targetid)
{
         
ShowPlayerDialog(targetidDIALOG_REGISTERDIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"{00CED1} Welcome to  Server \n{FFFFFF} Type your password below to register a new account.","Register","Quit");

i want to ask it Work Fine?
Reply
#2

Nope, that wont work, you have to get the whole register code at setname.... And remove the old file.
Reply
#3

i am working it so that why i am asking !!
Reply
#4

Test it. It will work though why you really need this little snippet with the timer? to me seems useless..
Reply
#5

i put the timer because i want when admin change name then it show Target id Register Dailogs with to register with new Name
Reply
#6

Quote:
Originally Posted by MBilal
Посмотреть сообщение
i put the timer because i want when admin change name then it show Target id Register Dailogs with to register with new Name
Why don't you test if it works actualy?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)