SA-MP Forums Archive
SendClientMessage for Dialogue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SendClientMessage for Dialogue (/showthread.php?tid=586910)



SendClientMessage for Dialogue - JoshNudock - 26.08.2015

Hello, I have a problem, I want to make this command in dialogue, how can I do? I tried, did not work and lost the code I did, someone help me? worth more reputation!

PHP код:
    if(strcmp(cmd"/sought"true) == 0)
    {
            if(
IsAMilitares(playerid))
            {
                   if(
OnDuty[playerid] != && GetPlayerOrg(playerid) != 2) return SendClientMessage(playerid,COLOR_GRAD1,"ERROR: You do not hit your card.");
                
SendClientMessage(playerid,COLOR_YELLOW,"Wanted Government:");
                for(new 
i=0GetMaxPlayers(); i++)
                {
                    if(
IsPlayerConnected(i))
                    {
                        if(
AccountData[i][pWantedLevel] > 0)
                        {
                            
format(stringsizeof(string), "%s - Search Level: %d",GetPlayerNameRP(i),AccountData[i][pWantedLevel]);
                            
SendClientMessage(playerid, -1string);
                        }
                    }
                }
                return 
1;
            }
            else 
SendClientMessage(playerid,COLOR_GRAD1,"ERRO: Restricted access only to military.");
        return 
1;
    } 



Re: SendClientMessage for Dialogue - jlalt - 26.08.2015

PHP код:
    if(strcmp(cmd"/sought"true) == 0)
    {
            if(
IsAMilitares(playerid))
            {
                   if(
OnDuty[playerid] != && GetPlayerOrg(playerid) != 2) return SendClientMessage(playerid,COLOR_GRAD1,"ERROR: You do not hit your card.");

                new 
string[128],content[128];
                for(new 
i=0GetMaxPlayers(); i++)
                {
                    if(
IsPlayerConnected(i))
                    {
                        if(
AccountData[i][pWantedLevel] > 0)
                        {
                            
format(stringsizeof(string), "{FFFFFF}%s - Search Level: %d",GetPlayerNameRP(i),AccountData[i][pWantedLevel]);
                            
strcat(contentstringsizeof(content));
                            
ShowPlayerDialog(playerid0DIALOG_STYLE_LIST"{FFFF00}Wanted Government:"content"Okey","");
                        }
                    }
                }
                return 
1;
            }
            else 
SendClientMessage(playerid,COLOR_GRAD1,"ERRO: Restricted access only to military.");
        return 
1;
    } 



Re: SendClientMessage for Dialogue - Threshold - 26.08.2015

Try this:
pawn Код:
if(!strcmp(cmd, "/sought", true))
    {
        if(!IsAMilitares(playerid)) return SendClientMessage(playerid, COLOR_GRAD1, "ERROR: Restricted access only to military.");
        if(OnDuty[playerid] != 1 && GetPlayerOrg(playerid) != 2) return SendClientMessage(playerid, COLOR_GRAD1, "ERROR: You do not hit your card.");
        new fstr[1000], tmpstr[50];
        strcat(fstr, "{FFFF00}Wanted Government:{FFFFFF}\n");
        for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
        {
            if(!IsPlayerConnected(i)) continue;
            if(!AccountData[i][pWantedLevel]) continue;
            format(tmpstr, sizeof(tmpstr), "\n%s - Search Level: %d", GetPlayerNameRP(i), AccountData[i][pWantedLevel]);
            if(strcat(fstr, tmpstr) >= sizeof(fstr)) break;
        }
        return 1;
    }