Unsolvable bugs?
#1

Hello and thanks for reading in the first place.

I'm making a gamemode with another guy and we noticed some weird bugs.
Things just won't be executed or they'll be executed in a wrong way. For example:

Код:
if(EmployeeInfo[playerid][vehicle] != 0)
		{
			DestroyVehicleX(EmployeeInfo[playerid][vehicle]);
			EmployeeInfo[playerid][vehicle]=0; // this won't be executed
		}
Also, OnPlayerSpawn will take $200 from the player instead of the scripted $100.
Before this mysterious bug came, everything was allright and all systems were working.
I'm sure it isn't a normal scripting mistake. I run through the code a thousand times, and this just make no sence at al.

Can someone help me?

Greetz,
Danny
Reply
#2

Could we see the DestroyVehicleX function?
Reply
#3

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Could we see the DestroyVehicleX function?
Ofcourse, but i'm afraid i cannot show too much of my gamemode here.

pawn Код:
forward DestroyVehicleX(Dvehicleid);
public DestroyVehicleX(Dvehicleid)
{
    DestroyVehicle(Dvehicleid);
    Iter_Remove(Vehicle, Dvehicleid);
    return Dvehicleid;
}
Reply
#4

Comment this:
pawn Код:
Iter_Remove(Vehicle, Dvehicleid);
to see what happens.
Reply
#5

DestroyVehicle(..) will halt the callback/segment if the vehicle ID is invalid (INVALID_VEHICLE_ID) or if the vehicle doesn't exist. Had the problem a week ago or so. This may not be your problem, but check to see if the vehicle is valid before acting on it.

Not sure about the OnPlayerSpawn issue though.
Reply
#6

the part which looks most suspect, are the $200 being taken.
my sugggestion is to use JernejL's ExecLogger plugin, it will direct you to why the player gets taken the double amount for sure. oh, backup your old server.log, i accidently got an almost 400MB sized file after playing a few minutes!
Reply
#7

That Execution Logger from JernejL is really amazing, thanks, i will keep using it with future bugs

Unfortunately it only shows me one GivePlayerMoneyX line. Another weird thing: If i give myself $500 dollars and then kill myself with /kill, i've $300 left. But when i look into the playerstats it shows me i have $400. I'm using serverside money so i guess the bug isn't affecting serverside money, but only takes clientside-money away from the player.

@CynIC: Thanks for your tip, i'll try as soon as i have a few friends around in my server.

@funky1234: Hmm, indeed, i'll make a if(.. check for that, thanks.
Reply
#8

$100 is taken from players money each death by default.
Reply
#9

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
$100 is taken from players money each death by default.
So why this didn't occur some days ago and suddenly it does?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)