Invalid Memory access
#1

Hello. I was training to create random commands & functions.
I get a strange error.
There is the commands:
PHP Code:
CMD:error(playerid)
{
    
ErrorMessage(playerid"Testing - Name : %s - Level : %i"GetName(playerid), GetPlayerScore(playerid));
    
ErrorMessage(playerid"Blabla"); // -> This line make the command return 0
    
ErrorMessage(playerid"Hi' - Money: %i"GetPlayerMoney(playerid));
    return 
1;
}
ErrorMessage(playerid, const msg[], va_args<>)
{
    new 
string[200];
    
format(stringsizeof(string), "[Erreur] "RED_U"%s"msg);
    
va_format(stringsizeof(string), stringva_start<3>);
    return 
SendClientMessage(playeridREDFstring);
}
GetName(playerid)
{
    static 
str[MAX_PLAYER_NAME];
    
GetPlayerName(playeridstrsizeof(str));
    return 
str;

The command doesnt't work well:
- Logs with the second line:
Code:
[16:49:37] [Erreur] {FF0000}Testing - Nom : cJina_Sawyers - Level : 
[16:49:37] Server: Unknown Command
- Crash detect logs:
Code:
[16:49:37] [debug] Run time error 5: "Invalid memory access"
[16:49:37] [debug] AMX backtrace:
[16:49:37] [debug] #0 00013b58 in ?? (0, 42720) from testing.amx
[16:49:37] [debug] #1 00013a58 in public cmd_error (0, 43596) from testing.amx
[16:49:37] [debug] #2 native CallLocalFunction () from samp-server.exe
[16:49:37] [debug] #3 00013b58 in ?? (0, 42720) from testing.amx
[16:49:37] [debug] #4 00013a58 in public OnPlayerCommandText (0, 43596) from testing.amx
- Without:
Code:
[16:52:13] [Erreur] {FF0000}Testing - Nom : cJina_Sawyers - Level : 
[16:52:13] [Erreur] {FF0000}Hi' - Money:
BUT there is no crash detect logs.

Thanks for your help.
Friendly, Dayrion.
Reply


Messages In This Thread
Invalid Memory access - by Dayrion - 08.08.2016, 14:56
Re: Invalid Memory access - by Ahmed21 - 08.08.2016, 15:01
Re: Invalid Memory access - by Shinja - 08.08.2016, 15:02
Re: Invalid Memory access - by Ahmed21 - 08.08.2016, 15:06
Re: Invalid Memory access - by Shinja - 08.08.2016, 15:10
Re: Invalid Memory access - by Dayrion - 08.08.2016, 15:12
Re: Invalid Memory access - by Ahmed21 - 08.08.2016, 15:13
Re: Invalid Memory access - by Dayrion - 08.08.2016, 15:26
Re: Invalid Memory access - by Shinja - 08.08.2016, 15:29
Re: Invalid Memory access - by Dayrion - 08.08.2016, 15:52

Forum Jump:


Users browsing this thread: 1 Guest(s)