SA-MP Forums Archive
Command Request - 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: Command Request (/showthread.php?tid=604129)



Command Request - Tass007 - 01.04.2016

Hai. I posted a topic here; https://sampforum.blast.hk/showthread.php?tid=599973

It was about my factions not working. I've isolated the problem and it's my CMD: request however I get no errors or anything. I found a script that has a working command of /request but I only had the .amx so I used the DEamxer and tried to convert it, but that didn't work...

I will post the two commands.

This is from my script that works, but the commands just doesn't...
PHP код:
CMD:request(playerid, params[])
{
    new 
tmp[256];
    if (
orgReq[playerid] > 0)
    {
        
SendClientMessage2(playerid, COLOR_ORANGE, "You are already requesting to join an organization.");
        
SendClientMessage2(playerid, COLOR_YELLOW, "Your request will not be withdrawn until you are accepted, declined or reconnect.");
        return 
1;
    }
    new 
moneys1 = dini_Int(AddDirFile(dir_orgfiles, FILE_OSTATS), "max_org");
    if (
moneys1 == 0) return SendClientMessage2(playerid, COLOR_SILVER, "There are currently no existing organizations.");
    if (
DoesPlayerHaveMenuOpen(playerid) || GetPlayerDialog(playerid) != -1) return SendClientMessage2(playerid, COLOR_WHITE, "SERVER: Please exit your current menu first.");
    new 
tmp3[1028];
    for (new 
orgg = 1; orgg <= moneys1; orgg++)
    {
        
format(tmp, 10, "ORG%d", orgg);
        if (!
dini_Exists(AddDirFile(dir_orgfiles, tmp))) continue;
        if (
adlvl[playerid] >= 3) format(tmp3, sizeof(tmp3), "%s\n{%s}%s (%d)\n", tmp3, dini_Get(AddDirFile(dir_orgfiles, tmp), "color"), dini_Get(AddDirFile(dir_orgfiles, tmp), "name"), orgg);
        else 
format(tmp3, sizeof(tmp3), "%s\n{%s}%s\n", tmp3, dini_Get(AddDirFile(dir_orgfiles, tmp), "color"), dini_Get(AddDirFile(dir_orgfiles, tmp), "name"), orgg);
    }
    
ShowPlayerDialog2(playerid, DIALOG_ORG_REQUEST, DIALOG_STYLE_LIST, "Select an organization to join.", tmp3, "Select", "Cancel");
    return 
1;
} 
Then here is the command that is supposed to work, but the De AMxer didn't do a good job :P

PHP код:
public cmd_request(playerid)
{
    new 
var0[256], var1[256], var2 = 0, var3[256];
    if(
0 < glob1FA5C[playerid])
    {
        
function18CB0(playerid, 0xFF9900FF, "You are already requesting to join an organization.");
        
function18CB0(playerid, 0xFFFF00FF, "Your request will not be withdrawn until you are accepted, declined or reconnect.");
        return 
1;
    }
    new 
var4 = function1598(function18BB4(1948612, 1948648), "max_org");
    if(!
var4)
    {
        return 
function18CB0(playerid, 0xDDDDDDFF, "There are currently no existing organizations.");
    }
    if(
functionC05EC(playerid) || -1 != function243A8(playerid))
    {
        return 
function18CB0(playerid, 0xFFFFFFFF, "SERVER: Please exit your current menu first.");
    }
    new 
var5[1028], var6[400];
    
format(var5, 1028, "%sOrganization\tMembers\tLeader", var5);
    for(new 
var7 = 1; var7 <= var4; var7++)
    {
        
var2 = 0;
        
format(var0, 10, "ORG%d", var7);
        new 
var8 = function1598(function18BB4(1949228, var0), "maxmembers");
        
var6 = function1B54(function18BB4(1949308, var0), "leader");
        for(new 
var9 = 1; var9 <= var8; var9++)
        {
            
format(var1, 12, "member%d", var9);
            if(
strcmp(function1B54(function18BB4(1949408, var0), var1), "server"))
            {
                
var2++;
            }
        }
        if(
strcmp(var6, "server"))
        {
            
format(var3, 256, "%s", var6);
        }
        else
        {
            
format(var3, 256, "None");
        }
        if(!
functionDF8(function18BB4(1949532, var0)))
        {
        }
        else
        {
        }
    }
    if(
var2 == var8)
    {
        
format(var5, 1028, "%s\n{%s}%s (%d)\tFull\t%s\n", var5, function1B54(function18BB4(1949664, var0), "color"), function1B54(function18BB4(1949724, var0), "name"), var7, var3);
    }
    else if(
var2 != var8)
    {
        
format(var5, 1028, "%s\n{%s}%s (%d)\tAvaliable\t%s\n", var5, function1B54(function18BB4(1949896, var0), "color"), function1B54(function18BB4(1949956, var0), "name"), var7, var3);
    }
    
function24288(playerid, 6, 5, 1950012, var5, 1950140, 1950168);
    return 
1;
} 
I've tried to convert them, but my Pawno stops working. With your amazing brains I'm sure you guys could help me out.

As always who ever helps me will get +1 Rep.

Thanks for your time.


Re: Command Request - Tass007 - 02.04.2016

Bump