SA-MP Forums Archive
Looking for an expert - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Looking for an expert (/showthread.php?tid=81813)



Looking for an expert - FreeSoul - 14.06.2009

Ok,this is a serious problem.
I have a heavily edited GF,as you know,in GF only people near you can see what you typed.But I have a problem.After like an hour or two of playing certain people start talking like in LVDM,everybody sees what they type and also their color.
Any suggestions? Why is this happening?
Thanks in advance


Re: Looking for an expert - Correlli - 14.06.2009

Upload your OnPlayerText code on pastebin and give us the link.


Re: Looking for an expert - DracoBlue - 14.06.2009

If this happens after a while, some of your code 'destroys' the mainthread of pawn-execution. This happens usually if you are writing to an array, and exceed the size, in a custom thread (for instance OnPlayerWhatever).

- Draco


Re: Looking for an expert - FreeSoul - 14.06.2009

Ok,this is the end of my code,the one with the chat.

Quote:

if (realchat)
{
if(gPlayerLogged[playerid] == 0)
{
return 0;
}
if(!strcmp(text, "lol", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s laughs out loud.", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "Don", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s says : Don Rullez !! ", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "omg", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s gasps, 'Oh My God!'", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "omfg", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s gasps, 'Oh My Fucking God!'", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "ty", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s says, 'Thanks!'", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "sry", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s gasps, 'I'm so sorry!'", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "wtf", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s shouts, 'What the fuck?!'", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "stfu", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s shouts, 'Shut the fuck up!'", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "w.e", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s mumbles, 'Whatever'", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "w/e", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s mumbles, 'Whatever'", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "lmao", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s laughs their ass off!", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "rofl", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s rolls around on the ground, laughing hysterically!", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "haha", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s laughs out loud.", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "afk", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s is now Away From Keyboard.", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "lmfao", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s laughs their fucking ass off!", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "brb", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s will be right back.", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "back", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s is now Back To Keyboard.", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "gg", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s shouts : Good Game !", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(!strcmp(text, "gj", true))
{
GetPlayerName(playerid, sendername, 24);
format(string, 256, "%s shouts : Good Job !", sendername);
ProxDetector(20.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
return 0;
}
if(NameOff[playerid] == 1)
{
GetPlayerName(playerid, plName[playerid], 26);
format(string, sizeof(string), "Unknown Says: %s", text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
return 0;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Says: %s", sendername, text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
return 0;
}

I would also like to add.This bug usually appears if the player doesn't see the welcome message.Like you know,every server has a welcomke message like "Welcome to...Type /login" or whatever,If the player doesn't see it he/she usualy has the bug.
Same for the Nameoff=1,if the player doesn't see the welcome message and has nameoff=1 the bug will appear

Thanks in advance


Re: Looking for an expert - FreeSoul - 14.06.2009

So? anybody?


Re: Looking for an expert - DracoBlue - 16.06.2009

I guess your heap/stack size exeeded.

Compile your script with -d2 as parameter for pawncc, too look how much it is. If it exceeds, you can try to increase your dynamic memory size (#pragma dynamic 400000 at the beginner of your script, default is 8000, though).

- Draco