Cmd Error / unknown command?
#1

Fixed


The error in console.

Код:
[debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[debug]  Stack pointer (STK) is 0xC3E0FC, heap pointer (HEA) is 0xC3F020
[debug] AMX backtrace:
[debug] #0 ???????? in public cmd_applications () from Compile.amx
[debug] #1 native CallLocalFunction () [004743b0] from samp-server.exe
[debug] #2 ???????? in public OnPlayerCommandText () from Compile.amx
the code for the command.

Код:
COMMAND:applications(playerid, params[])
{
	if(GetPVarInt(playerid, "Admin") >= 1 || IsPlayerAdmin(playerid))
	{
		new str[256];
		for(new i = 1; i < MAX_APPLICATIONS; i++)
		{
		    if(ApplicationInfo[i][SentIn] == 1)
		    {
		    	format(str, sizeof(str), "%s\n", ApplicationInfo[i][Name]);
			}
		}
	    ShowPlayerDialog(playerid, ApplicationsPick, DIALOG_STYLE_LIST, "Applications", str, "View", "Cancel");
	    return 1;
	}
	else return SendClientMessage(playerid, COLOR_RED, "Server: You do not have permission to use this command.");
}
Reply
#2

try

PHP код:
COMMAND:applications(playeridparams[])
{
    if(
GetPVarInt(playerid"Admin") >= || IsPlayerAdmin(playerid))
    {
        new 
str[256];
        for(new 
1MAX_APPLICATIONSi++)
        {
            if(
ApplicationInfo[i][SentIn] == 1)
            {
                
format(strsizeof(str), "%s\n"ApplicationInfo[i][Name]);
            }
        }
        return 
ShowPlayerDialog(playeridApplicationsPickDIALOG_STYLE_LIST"Applications"str"View""Cancel");
    }
    else
    {
        
SendClientMessage(playeridCOLOR_RED"Server: You do not have permission to use this command.");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)