[Untested]Cash on Body

Started by Finch Real, Jul 21, 2016, 01:50 PM

Previous topic - Next topic

Finch Real

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!
My Snipet Showroom

http://pastebin.com/5KKuU5cg

Kewun

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.

KAKAN

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
oh no

Cool

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.

Finch Real

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
My Snipet Showroom

http://pastebin.com/5KKuU5cg

KAKAN

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.
oh no

Finch Real

If you think marker will mess out your server remove it...
My Snipet Showroom

http://pastebin.com/5KKuU5cg

Thijn

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.

Finch Real

My Snipet Showroom

http://pastebin.com/5KKuU5cg

rww

This isn't a good script. Because, when I do suicide in skimmer (or any heli) and money are flying above city...
Join to Irrelevant Club Discord: https://discord.gg/MsPPZ5uV4X

Finch Real

Why you will do /kill while in heli or skimmer?
My Snipet Showroom

http://pastebin.com/5KKuU5cg

KAKAN

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?
oh no

Finch Real

You guys are just useless
My Snipet Showroom

http://pastebin.com/5KKuU5cg