Author Topic: How to cancel %v.player.kill();  (Read 3160 times)

Tell me how please.

Code:

Code: [Select]
package 30secondkill
{
if(!isObject(%client.minigame))
    return;

function onVehicleExit(%client,%v)
{
%client = findClientByName();
%v.player.kill();

for (%v = %v.player.kill(); %v.player.kill = schedule('30'); %v++)
{
return %v;
}

}

function onPlayerSpawn()
{
onPlayerSpawn(schedule('90',%v.player.kill();));

for (%v = onVehicleEnter = %v.player.kill.cancel(); %v++)
{
return %v;
}
}
};
activatePackage(30secondkill);
« Last Edit: September 01, 2012, 02:05:50 PM by Deoxys And One Noob »

if(!isObject(%client.minigame))
    return;

do stuff here


Instead of using %client.minigame it's preferred that you use getMinigameFromObject(%client).

Instead of using %client.minigame it's preferred that you use getMinigameFromObject(%client).
What's the difference besides one takes slightly longer because it uses a function?

OK, how do you cancel %v.player.kill();


by not calling it..?

Er...

Show me the code, I'm not familiar with calling.
« Last Edit: September 01, 2012, 02:17:21 PM by Deoxys And One Noob »

Er...

Show me the code.
what do you mean "cancel"? it's a function, if you call it it does stuff. What do you mean, you want it to just not do anything?

I really have no idea what OP is trying to do.

I really have no idea what OP is trying to do.

I just don't want %v.player.kill(); to function when the OnVehicleEnter function is executed.

The player is killed immediately, how do you expect do stop him from being killed after that?

Let me explain.

The guy is on a 90 second timer, right?

When he enters the vehicle, I want that timer to be stopped.

That's what I want.

Let me explain.

The guy is on a 90 second timer, right?

When he enters the vehicle, I want that timer to be stopped.

That's what I want.
There are so many things wrong with your code, it's better to start from scratch. It makes no sense.

onVehicleExit and onPlayerSpawn are not functions, they are events (actually they are functions, but inside classes and it's not good to depend on them)

First, you'll have to found the proper function for exiting a vehicle and when the player spawns.