Server crashes due to Kick or Ban?
#1

Well, I am making a script (wich I may release here)
But for some reason I have a weird problem.

Everytime I use /kick, or /ban or any other form that uses Kick(playerid); or Ban(playerid); My server Instantly crashes, does someone know how this can happen?

Some info: Im using ZCMD, im using sscanf2. I have 7 warnings:

Код:
C:\Users\Laptop\Desktop\Server\gamemodes\***(905) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Laptop\Desktop\Server\gamemodes\***(914) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Laptop\Desktop\Server\gamemodes\***(940) : warning 202: number of arguments does not match definition
C:\Users\Laptop\Desktop\Server\gamemodes\***(1337) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:\Users\Laptop\Desktop\Server\gamemodes\***(1940) : warning 202: number of arguments does not match definition
C:\Users\Laptop\Desktop\Server\gamemodes\***(1940) : warning 202: number of arguments does not match definition
C:\Users\Laptop\Desktop\Server\gamemodes\UnitedNations.pwn(3620) : warning 235: public function lacks forward declaration (symbol "IsVehicleInUseByPlayer")
But I dont think that has anything to do with it.



Btw 2nd question: My Samp-Server exits when I leave GTA, anyone knows how?


Thanks in Advance,
Alpha500delta
Reply
#2

Ok, first two errors, you have a variable called 'name' that you declared two times, change one of them to something else, or make 1 global variable called 'name', that can be used for whatever you had in mind.

Third error, the function you were trying to use is missing a parameter, and will not run correctly unless the missing parameter is added. (Code needed)

Fourth, same as the first one, you have a variable that is declared two times, with the same name.

Fifth and Sixth are the same as the third error, you need to put in the missing parameter. (Code needed)

Last error, you forgot to do:

pawn Код:
forward IsVehicleInUseByPlayer(playerid, vehicleid);
Or something like that.

Look over your code for the obvious, and read what I typed. Good luck.

--

As for the second one, I'm not sure what is causing that.
Reply
#3

Thanks but, it's not errors but warnings.
Also I did do "forward IsVehicleInUseByPlayer(playerid, vehicleid);"

But does that explain why Kick and Ban crashes? (some wrong new's)
Reply
#4

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
But does that explain why Kick and Ban crashes? (some wrong new's)
Most likely - I had the same problem when i used a command once - it was so annoying, and i kicked myself when i figured out why xD
Reply
#5

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
But does that explain why Kick and Ban crashes? (some wrong new's)
Depends on if the kick / ban commands are linked to that function, or if that function is / was poorly created.
Reply
#6

Try adding
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));.
Reply
#7

Thats not it, it just crashes if I use Kick(playerid);
In any command, any function

Thanks for help, ill try fixing those warnings first


Edit: Warnings fixed, lets test

Edit2: AYAYAYAYAYAYAYAYAyAYAYYAAYAYAYAYAY fixed ty ALL!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)