SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 25/11/2009, 04:33 PM   #1
BMGP
Big Clucker
 
Join Date: Jun 2009
Location: Austria
Posts: 105
Reputation: 0
Default Something wrong with kills + money?!

Code:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(playerid,killerid,reason);
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
GivePlayerMoney(playerid,GetPlayerMoney(playerid)-100);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid,GetPlayerMoney(playerid)+100);
return 1;
}
Why the killer doesnt gets 100 $?
BMGP is offline  
Old 25/11/2009, 04:35 PM   #2
MB@
Huge Clucker
 
Join Date: Jul 2009
Posts: 203
Reputation: 1
Default Re: Something wrong with kills + money?!

Quote:
Originally Posted by BMGP
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(playerid,killerid,reason);
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
GivePlayerMoney(playerid,GetPlayerMoney(playerid)-100);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid,GetPlayerMoney(playerid)+100);
return 1;
}
Why the killer doesnt gets 100 $?
Code:
GivePlayerMoney(playerid,GetPlayerMoney(playerid)-100);
GivePlayerMoney(killerid,GetPlayerMoney(playerid)+100);
Because you putted to give -100 and +100 money and thats 0. Delete the -100 line.
MB@ is offline  
Old 25/11/2009, 04:41 PM   #3
BMGP
Big Clucker
 
Join Date: Jun 2009
Location: Austria
Posts: 105
Reputation: 0
Default Re: Something wrong with kills + money?!

Quote:
Originally Posted by Krys^
Quote:
Originally Posted by BMGP
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(playerid,killerid,reason);
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
GivePlayerMoney(playerid,GetPlayerMoney(playerid)-100);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid,GetPlayerMoney(playerid)+100);
return 1;
}
Why the killer doesnt gets 100 $?
Code:
GivePlayerMoney(playerid,GetPlayerMoney(playerid)-100);
GivePlayerMoney(killerid,GetPlayerMoney(playerid)+100);
Because you putted to give -100 and +100 money and thats 0. Delete the -100 line.
but one for playerid and one for killerid
BMGP is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Server-sided Money - Stop money hackers! NEW RELEASE(v6) x-cutter Includes 107 30/08/2011 07:56 PM
[FilterScript] [FS]RegServ, saves kills/deaths/money/wantedlvl/level & stats + some Xadmin cmds SmartyPants Filterscripts 33 21/12/2010 04:16 PM
[FilterScript] [FS] Money Cheat Detector || Stop money cheaters! Luka P. Filterscripts 22 05/09/2010 12:22 AM
change from money to kills 02manchestera Help Archive 2 04/03/2010 05:13 PM


All times are GMT. The time now is 11:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.