[20:07:29] [debug] Run time error 5: "Invalid memory access" [20:07:29] [debug] AMX backtrace: [20:07:29] [debug] #0 000169b0 in ?? (0, 628228) from test.amx [20:07:29] [debug] #1 0001808c in public cmd_jetpack (0, 628408) from test.amx [20:07:29] [debug] #2 native CallLocalFunction () from samp-server.exe [20:07:29] [debug] #3 000169b0 in ?? (0, 628228) from test.amx [20:07:29] [debug] #4 0001808c in public OnPlayerCommandText (0, 628408) from test.amx
Console input: gmx [20:07:50] [debug] Run time error 6: "Invalid instruction" [20:07:50] [debug] Unknown opcode 0x99604 at address 0x00099604 [20:07:50] [debug] AMX backtrace: [20:07:50] [debug] #0 00099604 in public ScriptInit_OnGameModeExit () from test.amx [20:07:50] [debug] #1 000065d0 in public OnGameModeExit () from test.amx
[20:07:49] [debug] Run time error 6: "Invalid instruction" [20:07:49] [debug] Unknown opcode 0xf0000 at address 0x000000BE [20:07:49] [debug] AMX backtrace: [20:07:49] [debug] #0 000000be in public OnPlayerKeyStateChange (0, 1024, 0) from test.amx
CMD:jetpack(playerid)
{
if(pAccount[playerid][pAdmin] < GMODO) return ErrorMsg(playerid, _, false);
SetPlayerSpecialAction(playerid, GetPlayerSpecialAction(playerid) == 2 ? 0 : 2);
SCM(playerid, -1, "Passed"); // Debug
if(GetPlayerSpecialAction(playerid) == 2)
return AdminMessage(playerid, "You have remove your jetpack"), 1;
else
return AdminMessage(playerid, "You have spawned a jetpack"), 1;
}
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Header size: 5524 bytes Code size: 117384 bytes Data size: 628312 bytes Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion Total requirements: 767604 bytes
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Header size: 5644 bytes Code size: 203648 bytes Data size: 630048 bytes Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion Total requirements: 855724 bytes [Finished in 2.7s]
[20:07:29] [debug] #0 000169b0 in ?? (0, 62822 ![]() |
21:23:18] [debug] Run time error 5: "Invalid memory access" [21:23:18] [debug] AMX backtrace: [21:23:18] [debug] #0 0002fa80 in AdminMessage (playerid=0, message[]=@000999ec "") at test.pwn:514 [21:23:18] [debug] #1 00031860 in public cmd_jetpack (playerid=0, ... <1 argument>) at test.pwn:708 [21:23:18] [debug] #2 native CallLocalFunction () from samp-server.exe [21:23:18] [debug] #3 0002fa80 in AdminMessage (playerid=0, message[]=@000999ec "") at test.pwn:514 [21:23:18] [debug] #4 00031860 in public OnPlayerCommandText (playerid=0, cmdtext[]=@00099d44 "") at test.pwn:708
CMD:jetpack(playerid)
{
if(pAccount[playerid][pAdmin] < GMODO) return ErrorMsg(playerid, _, false);
SetPlayerSpecialAction(playerid, GetPlayerSpecialAction(playerid) == 2 ? 0 : 2);
SCM(playerid, -1, "Passed"); // Debug
if(GetPlayerSpecialAction(playerid) == 2)
return AdminMessage(playerid, "You have remove your jetpack"), 1;
else
{
AdminMessage(playerid, "You have spawned a jetpack");
return 1;
}
[21:24:53] [debug] Run time error 5: "Invalid memory access" [21:24:53] [debug] AMX backtrace: [21:24:53] [debug] #0 0002fa80 in AdminMessage (playerid=0, message[]=@000999ec "") at test.pwn:514 [21:24:53] [debug] #1 00031860 in public cmd_jetpack (playerid=0, ... <1 argument>) at test.pwn:710 [21:24:53] [debug] #2 native CallLocalFunction () from samp-server.exe [21:24:53] [debug] #3 0002fa80 in AdminMessage (playerid=0, message[]=@000999ec "") at test.pwn:514 [21:24:53] [debug] #4 00031860 in public OnPlayerCommandText (playerid=0, cmdtext[]=@00099d44 "") at test.pwn:710
AdminMessage(playerid, const message[], va_args<>)
{
static msg[190];
va_format(msg, sizeof(msg), message, va_start<3>);
return SCMF(playerid, RED, "Admin:"WHITE_U" %s", msg);
}
CMD:jetpack(playerid)
{
if(pAccount[playerid][pAdmin] < GMODO) return ErrorMsg(playerid, _, false);
SetPlayerSpecialAction(playerid, GetPlayerSpecialAction(playerid) == 2 ? 0 : 2);
SCM(playerid, -1, "Passed"); // Debug
if(GetPlayerSpecialAction(playerid) == 2)
return AdminMessage(playerid, "You have remove your jetpack", 0);
else
return AdminMessage(playerid, "You have spawned a jetpack", 0);
}
va_AdminMessage(playerid, const message[], va_args<>)
{
static msg[190];
static const premsg[] = "Admin:"WHITE_U" %s";
if(numargs() == 2) return SCMF(playerid, RED, premsg, msg);
va_format(msg, sizeof(msg), message, va_start<3>);
return SCMF(playerid, RED, premsg, msg);
}
//Somewhere at the top of your script
#define AdminMessage(%0,%1,%2) va_AdminMessage(%0,%1,%2)
//then
AdminMessage(playerid, const message[])
{
return SCMF(playerid, RED, "Admin:"WHITE_U" %s", msg);
}
va_AdminMessage(playerid, const message[], va_args<>)
{
static msg[190];
va_format(msg, sizeof(msg), message, va_start<3>);
return SCMF(playerid, RED, "Admin:"WHITE_U" %s", msg);
}
Try this
pawn Код:
pawn Код:
|
AdminMessage(playerid, const message[], va_args<>)
{
static msg[190];
static const premsg[] = "Admin:"WHITE_U" %s";
if(numargs() == 2) return SCMF(playerid, RED, premsg, message);
va_format(msg, sizeof(msg), message, va_start<3>);
return SCMF(playerid, RED, premsg, msg);
}