9999999/999999 code crashing the gamemode? - 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: 9999999/999999 code crashing the gamemode? (
/showthread.php?tid=67242)
9999999/999999 code crashing the gamemode? -
Mr187 - 27.02.2009
well, latly people come in my server at times and type codes like 999999/9999999/9999999 etc and it crashes up my whole gamemode and its just all off and just a main chat and thats it and i would have to reload the gamemode or restart server for it to be back on. but ive added a thing so that if someone types "999/" it auto kicks them and its kinda solved the problem because a person tried doing it and it kicked them and 10 seconds later it rebooted the script and everything went back to normal, when they first started doing this it didn't do that but is anyone else having these problems and no a way to fix it fully without having to have my game mode restart every 10 seconds because i really like to fix this problem fully
and also i have seen it happen at other servers using gamemodes nothing like my.
Re: 9999999/999999 code crashing the gamemode? -
Yaheli_Faro - 27.02.2009
It's a strval bug. just make sure the length of the string can't pass 15-20 and it should be fine.
Re: 9999999/999999 code crashing the gamemode? -
Jefff - 27.02.2009
Код:
public OnPlayerCommandText(playerid, cmdtext[]){
if(strlen(cmdtext) >= 32) return 0;
And solved
Re: 9999999/999999 code crashing the gamemode? -
Yaheli_Faro - 27.02.2009
Quote:
Originally Posted by Jefff
Код:
public OnPlayerCommandText(playerid, cmdtext[]){
if(strlen(cmdtext) >= 32) return 0;
And solved
|
And if I were to type "/kick 32 exsesive use of cheats (weapons)" It wouldn't allow that
put
pawn Код:
if(strlen(cmdtext) >= 32) return 1;
Inside the code for the command itself.
Re: 9999999/999999 code crashing the gamemode? -
Jefff - 27.02.2009
Yes i know and little correct xD strval crash > 49
Re: 9999999/999999 code crashing the gamemode? -
Mr187 - 28.02.2009
thanks guys i been looking for something to fix it
Re: 9999999/999999 code crashing the gamemode? -
Extremo - 17.07.2010
A better solution would be:
Код:
stock strvalEx(string[])
{
if(strlen(string) < 32)
{
return strval(string);
}
return 0;
}
I hope nobody minds that I kinda bump this thread. Its just that I think this is useful to the poster and to anyone else searching and finding this topic.
Re: 9999999/999999 code crashing the gamemode? -
kc - 17.07.2010
It is also useful to note that this problem was fixed with SA-MP 0.3, so your bump was completely useless!
Re: 9999999/999999 code crashing the gamemode? -
Bella1 - 12.01.2011
No need to be a Asshole..
Re: 9999999/999999 code crashing the gamemode? -
admantis - 12.01.2011
Quote:
Originally Posted by Bella1
No need to be a Asshole..
|
I don't know how he is being an asshole.