9999999/999999 code crashing the gamemode?
#1

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.
Reply
#2

It's a strval bug. just make sure the length of the string can't pass 15-20 and it should be fine.
Reply
#3

Код:
public OnPlayerCommandText(playerid, cmdtext[]){
if(strlen(cmdtext) >= 32) return 0;
And solved
Reply
#4

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.
Reply
#5

Yes i know and little correct xD strval crash > 49
Reply
#6

thanks guys i been looking for something to fix it
Reply
#7

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.
Reply
#8

It is also useful to note that this problem was fixed with SA-MP 0.3, so your bump was completely useless!
Reply
#9

No need to be a Asshole..
Reply
#10

Quote:
Originally Posted by Bella1
Посмотреть сообщение
No need to be a Asshole..
I don't know how he is being an asshole.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)