Cmd Error / unknown command? - 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: Cmd Error / unknown command? (
/showthread.php?tid=629771)
Cmd Error / unknown command? -
TheLeech - 03.03.2017
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.");
}
Respuesta: Cmd Error / unknown command? -
Eloy - 04.03.2017
try
PHP код:
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]);
}
}
return ShowPlayerDialog(playerid, ApplicationsPick, DIALOG_STYLE_LIST, "Applications", str, "View", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Server: You do not have permission to use this command.");
}
return 1;
}