Make a command on dialog
#1

Hi all, i want to chabge this comand on Dialog but i don't know how

Command:


PHP код:
CMD:fwarn(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return SCM(playeridCOLOR_LIGHTRED"Nu esti logat!");
    new 
id,sendername[30],giveplayer[30],string[100];
    if(
IsPlayerConnected(playerid))
    {
        if(
PlayerInfo[playerid][pLeader] >= 1)
        {
            if(
sscanf(params"u"id)) return SCM(playerid,COLOR_WHITE,"Tasteaza: /fwarn <Name/Playerid>");
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
GetPlayerName(idgiveplayersizeof(giveplayer));
            if(
PlayerInfo[id][pLeader] >= 1) return SCM(playerid,COLOR_WHITE,"{FFB870}The player is leader.");
            if(
PlayerInfo[id][pMember] > && (PlayerInfo[id][pMember] == PlayerInfo[playerid][pLeader]))
            {
                if(
IsPlayerConnected(id))
                {
                    if(
id != INVALID_PLAYER_ID)
                    {
                        
PlayerInfo[id][pFACWarns] += 1;
                        
format(stringsizeof(string), "You gave to %s a faction warn."giveplayer);
                        
SCM(playeridCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "Leader %s gave you a faction warn."sendername);
                        
SCM(idCOLOR_LIGHTBLUEstring);
                        new 
wakaname[25],str[250];
                        
GetPlayerName(id,wakaname,sizeof(wakaname));
                        
format(str,sizeof(str),"UPDATE users SET `FWarn`='%d' WHERE `name`='%s'",PlayerInfo[id][pFACWarns],wakaname);
                        
mysql_query(SQL,str);
                        
Factionlog(PlayerInfo[id][pMember],PlayerInfo[id][pSQLID],"Received Faction Warn.");
                        if(
PlayerInfo[id][pFACWarns] >= 3)
                        {
                            
gTeam[id] = 3;
                            
PlayerInfo[id][pTeam] = 3;
                            
PlayerInfo[id][pMember] = 0;
                              
PlayerInfo[id][pLeader] = 0;
                            
PlayerInfo[id][pRank] = 0;
                            
PlayerInfo[id][pChar] = 0;
                            
PlayerInfo[id][pFpunish] = 10;
                            
PlayerInfo[id][pFACWarns] = 0;
                            
OnDuty[id] = 0;
                            
SetPlayerArmourEx(id0);
                            
format(stringsizeof(string), "Liderul %s te-a scos din factiune (3/3 avertismente) cu 10/20 FPunish!"sendername);
                            
SCM(idCOLOR_LIGHTBLUEstring);
                            
SetPlayerSkin(id,PlayerInfo[id][pModel]);
                            
SpawnPlayer(id);
                            
format(str,sizeof(str),"UPDATE users SET `Team`='3',`Member`='0',`Leader`='0',`Rank`='0',`CChar`='0',`FPunish`='10',`FWarn`='0' WHERE `name`='%s'",wakaname);
                            
mysql_query(SQL,str);
                        }
                        return 
1;
                    }
                }
                else return 
SCM(playeridCOLOR_WHITE"Jucatorul nu este conectat.");
            }
            else return 
SCM(playeridCOLOR_WHITE"Player isn't in your faction.");
        }
        else return 
SCM(playerid0xFFB870FF"Only leaders can use this command.");
    }
    return 
1;

And now i don't know how to make it, give rep
Reply
#2

What do you mean by changing it into a dialog? Typing the player ID/name in the dialog or just displaying the info?
Reply
#3

Yes, i want type the ID/playername in dialog
Reply
#4

Look what i made

PHP код:
CMD:fpanel(playerid,params[])
{
    if (
PlayerInfo[playerid][pMember] >= && PlayerInfo[playerid][pRank] >= 6)
    {
        
ShowPlayerDialog(playeridDIALOG_F_PANELDIALOG_STYLE_LIST"Panel liderii:""Invita un jucator\nScoate un jucator afara\nSeteaza rank-ul unui jucator\nSeteaza jobul\nAdvertisment jucator\nScoate advertisment\n""Select""Cancel");
    }
    else
    {
        
SendClientMessage(playerid,-1,"Nu esti lider / co-lider !");
    }
    return 
1;

Dialog
PHP код:
if(dialogid == DIALOG_F_PANEL)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
ShowPlayerDialog(playeridDIALOG_DIALOG_F_PANEL2DIALOG_STYLE_INPUT"Panel lideri:""Scrie numele jucatorului sau introdu id-ul jucatorului""Ok""Cancel");    
            }
            if(
listitem == 1)
            {
                    
            }
            if(
listitem == 2)
            {
                    
            }
            if(
listitem == 3)
            {
                    
            }
            if(
listitem == 4)
            {
                    
            }
            if(
listitem == 5)
            {
                    
            }
        }
        return 
1;
    } 
Dialog [2]

PHP код:
if(dialogid == DIALOG_DIALOG_F_PANEL2)
    {
        if(
response)
        {
            new 
id,Fstring[100],giveplayer[30],Fsendername[30];
            if(
sscanf(params"u"id)) return SCM(playerid0xFFFFFFFF,"Tasteaza: /invite <Name/Playerid>");
            new 
ftext[120];
            if(
PlayerInfo[id][pFpunish] != 0) return SCM(playerid,COLOR_WHITE,"{FFB870}You can not invite this player because it has faction punish");
            if(
IsPlayerConnected(id))
            {
                if(
id != INVALID_PLAYER_ID)
                {
                    if(
PlayerInfo[id][pMember] == && PlayerInfo[id][pLeader] == 0)
                    {
                        if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 1)
                        {
                            
PlayerInfo[id][pTeam] = 2;
                            
gTeam[id] = 2;
                            
ftext "LSPD";
                            
ChosenSkin[id] = 266;
                            
SetPlayerSkin(id266);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 2)
                        {
                            
PlayerInfo[id][pTeam] = 2;
                            
gTeam[id] = 2;
                            
ftext "Dillimore Police Departament";
                            
ChosenSkin[id] = 288;
                            
SetPlayerSkin(id288);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 3)
                        {
                            
PlayerInfo[id][pTeam] = 2;
                            
gTeam[id] = 2;
                            
ftext "Las Venturas Police Departament";
                            
ChosenSkin[id] = 71;
                            
SetPlayerSkin(id71);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 4)
                        {
                            
PlayerInfo[id][pTeam] = 5;
                            
gTeam[id] = 5;
                            
ftext "Ballas";
                            
ChosenSkin[id] = 104;
                            
SetPlayerSkin(id104);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 5)
                        {
                            
PlayerInfo[id][pTeam] = 5;
                            
gTeam[id] = 5;
                            
ftext "Los Aztecas";
                            
ChosenSkin[id] = 114;
                            
SetPlayerSkin(id114);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 6)
                        {
                            
PlayerInfo[id][pTeam] = 5;
                            
gTeam[id] = 5;
                            
ftext "Los Santos Vagos";
                            
ChosenSkin[id] = 108;
                            
SetPlayerSkin(id108);
                        }
                           else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 7)
                           {
                            
PlayerInfo[id][pTeam] = 2;
                            
gTeam[id] = 2;
                            
ftext "Factiunea Staffului";
                            
ChosenSkin[id] = 228;
                            
SetPlayerSkin(id228);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 8)
                        {
                            
PlayerInfo[id][pTeam] = 4;
                            
gTeam[id] = 4;
                            
ftext "Tow Car Co.";
                            
ChosenSkin[id] = 42;
                            
SetPlayerSkin(id42);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == 9)
                        {
                            
PlayerInfo[id][pTeam] = 4;
                            
gTeam[id] = 4;
                            
ftext "News Reporter";
                            
ChosenSkin[id] = 72;
                            
SetPlayerSkin(id72);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pMember] == 10)
                        {
                            
PlayerInfo[id][pTeam] = 5;
                            
gTeam[id] = 5;
                            
ftext "Grove Street";
                            
ChosenSkin[id] = 107;
                            
SetPlayerSkin(id107);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 11)
                        {
                            
PlayerInfo[id][pTeam] = 11;
                            
gTeam[id] = 11;
                            
ftext "Hitman Agency";
                            
ChosenSkin[id] = 120;
                            
SetPlayerSkin(id120);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 12)
                        {
                            
PlayerInfo[id][pTeam] = 4;
                            
gTeam[id] = 4;
                            
ftext "School Instructor";
                            
ChosenSkin[id] = 101;
                            
SetPlayerSkin(id101);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pMember] == 13)
                        {
                            
PlayerInfo[id][pTeam] = 4;
                            
gTeam[id] = 4;
                            
ftext "Taxi Company";
                            
ChosenSkin[id] = 261;
                            
SetPlayerSkin(id261);
                        }
                        else if(
PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 14)
                        {
                            
PlayerInfo[id][pTeam] = 4;
                            
gTeam[id] = 4;
                            
ftext "Paramedic Dep.";
                            
ChosenSkin[id] = 276;
                            
SetPlayerSkin(id276);
                        }
                        else { return 
1; }
                        
GetPlayerName(idgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridFsendernamesizeof(Fsendername));
                        
PlayerInfo[id][pMember] = PlayerInfo[playerid][pMember];
                        
PlayerInfo[id][pRank] = 1;
                        
printf("AdmCmd: %s has invited %s to join %s."Fsendernamegiveplayerftext);
                        
format(Fstringsizeof(Fstring), "Ai fost invitat de catre liderul %s in factiunea %s!"Fsendername,ftext);
                        
SCM(idCOLOR_LIGHTBLUEFstring);
                        
format(Fstringsizeof(Fstring), "L-ai invitat pe %s in factiunea ta."giveplayer);
                        
SCM(playeridCOLOR_LIGHTBLUEFstring);
                        
SetPlayerHealthEx(id0);
                        new 
wakaname[25],str[128];
                        
GetPlayerName(id,wakaname,sizeof(wakaname));
                        
format(str,sizeof(str),"UPDATE users SET `Team`='%d',`Member`='%d',`Rank`='1' WHERE `name`='%s'",PlayerInfo[id][pTeam],PlayerInfo[id][pMember],wakaname);
                        
mysql_query(SQL,str);
                        
Factionlog(PlayerInfo[id][pMember],PlayerInfo[id][pSQLID],"Joined the Faction.");
                    }
                    else
                    {
                        
SCM(playerid0xFFB870FF"This player has wanted or is already in a faction.");
                        return 
1;
                    }
                }
            }
            return 
1;
        
        }
    } 
And i have one error

PHP код:
New.pwn(44627) : error 017undefined symbol "params" 
Reply
#5

change params with:
PHP код:
inputtext 
Reply
#6

Thank you @jlalt
Reply
#7

Quote:
Originally Posted by Sn4ke2
Посмотреть сообщение
Thank you @jlalt
you're welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)