katursis / Pawn.CMD

🚀 Plugin-powered command processor for SA:MP server
MIT License
119 stars 13 forks source link

[Pawn.CMD] - Invalid memory access #33

Closed canciftci closed 3 years ago

canciftci commented 3 years ago

Hey there,

After a command, I'm getting this and also nothing on the server won't be able to use as well. (Like, textdraws won't work, dialogs won't respond)

[Pawn.CMD] HandleCommand: Call: amx_Exec(struct tagAMX :02253BA8, int :0018F7D8, int:499): Invalid memory access (5)

cmd:testcmd(playerid, params[])
{
    if(!AdminCheck(playerid, ADMIN_LEVEL123)) return 1; // Basically, controlling if the user is admin or not.
    new gelbakak[32];
    format(gelbakak, sizeof(gelbakak), "%s", RutbeAdi(playerid)); // This is a function returning a string from some player variables. Like if adminlevel[playerid] == 3 >> Returns a text "This is a Super admin"

    FixTurkishCharacters(gelbakak); // And then this, I'll give it below.
    SendClientMessage(playerid, -1, gelbakak);
    return 1;
}
stock FixTurkishCharacters(icerik[])
{
    strreplace(icerik, 'Ş', 'S');
    strreplace(icerik, 'ş', 's');
    strreplace(icerik, 'Ö', 'O');
    strreplace(icerik, 'ö', 'o');
    strreplace(icerik, 'Ü', 'U');
    strreplace(icerik, 'ü', 'u');
    strreplace(icerik, 'İ', 'I');
    strreplace(icerik, 'ı', 'i');
    strreplace(icerik, 'Ğ', 'G');
    strreplace(icerik, 'ğ', 'g');
    strreplace(icerik, 'Ç', 'C');
    strreplace(icerik, 'ç', 'c');
    return icerik;
}

BY THE WAY; I'm using the same function in another command, it works fine.

cmd:testchar(playerid, params[]) // THIS WORKS PROPERLY. BUT THE OTHER COMMAND WON'T.
{
    if(!AdminCheck(playerid,  ADMIN_LEVEL123)) return 1;
    FixTurkishCharacters(params);
    SCM(playerid,-1,params);
    return 1;
}
soknifedev commented 3 years ago

Hi there. Which version of SA:MP are you using? This plugin uses memory hacking.

katursis commented 3 years ago

It's an AMX (pawn) error, not the plugin error. The plugin just informs you about an error in your script.