Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: Finch Real on Jul 21, 2016, 01:50 PM

Title: [Untested]Cash on Body
Post by: Finch Real on Jul 21, 2016, 01:50 PM
function onPlayerKill( killer, player, reason, bodypart )
{
  local x = player.Pos.x, y = player.Pos.y, z = player.Pos.z;
local cash = Vector( x.tofloat() + 1, y.tofloat() + 1, z.tofloat() );
CreatePickup( 337, cash );
MessagePlayer( "You have lost 50$", player );
player.Cash -= 50;
Message( "State Alert - 50$ is on the ground Follow the radar on marker to find it and claim it" );
}
function onPlayerDeath( player, reason )
{
    local x = player.Pos.x, y = player.Pos.y, z = player.Pos.z;
local cash = Vector( x.tofloat() + 1, y.tofloat() + 1, z.tofloat() );
CreatePickup( 337, cash );
MessagePlayer( "You have lost 50$", player );
player.Cash -= 50;
Message( "State Alert - 50$ is on the ground Follow the radar on marker to find it and claim it" );
}
function onPickupPickedUp( player, pickup )
{
if ( pickup.Model == 337 )
{
MessagePlayer( "You have claimed 50$", player );
player.Cash += 50;
pickup.Remove();
}
}
I am not from pc so I haven't tested Code But i am sure it will works
Updated!
Title: Re: [Untested]Cash on Body
Post by: Kewun on Jul 21, 2016, 01:52 PM
i think wont work, because te cash pickup is created on the player's pos. player can pick it up already on death so no one can collect it.
thats what i was told.
Title: Re: [Untested]Cash on Body
Post by: KAKAN on Jul 21, 2016, 01:55 PM
your code won't work. Suppose, I got killed and someone else died, what will happen now? I think there would be 2 markers, when picked up, one will get removed. I don't know as I haven't tested it, but that's what I think would happen
Title: Re: [Untested]Cash on Body
Post by: Cool on Jul 21, 2016, 01:55 PM
QuoteVerify that the script is working properly.
Take your script, extract it, and start fresh with the latest Squirrel server available. If you are using a database, erase it and start from scratch. Make absolutely sure that all functions and commands are working as they should.

If your script uses a database, make sure that you either add a bare-bones Database file with all unnecessary entries removed, or that you include a file with the CREATE TABLE/INSERT statements that need to be run.
Title: Re: [Untested]Cash on Body
Post by: Finch Real on Jul 21, 2016, 01:56 PM
Updated @Kewun @KAKAN  I have create it for not only one Pickup It will create as much when player died and will get removed when someone pickit
Title: Re: [Untested]Cash on Body
Post by: KAKAN on Jul 21, 2016, 01:59 PM
Quote from: Finch Real on Jul 21, 2016, 01:56 PMUpdated @Kewun @KAKAN  I have create it for not only one Pickup It will create as much when player died and will get removed when someone pickit
What about the marker? It's only one variable which is being used for every player. Create a array instead.
Title: Re: [Untested]Cash on Body
Post by: Finch Real on Jul 21, 2016, 02:01 PM
If you think marker will mess out your server remove it...
Title: Re: [Untested]Cash on Body
Post by: Thijn on Jul 22, 2016, 06:10 AM
Quote from: Finch Real on Jul 21, 2016, 02:01 PMIf you think marker will mess out your server remove it...
It will mess up your server, so either fix it in your snippet or remove it.
Title: Re: [Untested]Cash on Body
Post by: Finch Real on Jul 22, 2016, 08:52 AM
Updated!
Title: Re: [Untested]Cash on Body
Post by: rww on Jul 22, 2016, 09:44 AM
This isn't a good script. Because, when I do suicide in skimmer (or any heli) and money are flying above city...
Title: Re: [Untested]Cash on Body
Post by: Finch Real on Jul 22, 2016, 09:51 AM
Why you will do /kill while in heli or skimmer?
Title: Re: [Untested]Cash on Body
Post by: KAKAN on Jul 22, 2016, 10:08 AM
Quote from: Finch Real on Jul 22, 2016, 09:51 AMWhy you will do /kill while in heli or skimmer?
what if someone else kills him while flying or blasts his heli while flying?
Title: Re: [Untested]Cash on Body
Post by: Finch Real on Jul 22, 2016, 10:43 AM
You guys are just useless