SA-MP Forums Archive
Problem in save - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem in save (/showthread.php?tid=660860)



Problem in save - Spawe - 15.11.2018

-and also when a player eliminates another one does not give him the + 300 $ of money and neither the +1 score


Code:
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
SendDeathMessage(killeridplayeridreason);
    
SetPlayerScore(killerid,(GetPlayerScore(killerid))+1);
    
GivePlayerMoney(killerid400);
     new 
string[50];
    
format(stringsizeof(string), "~g~+$400");
    
GameTextForPlayer(killeridstring30001);
    return 
1;
}
//public OnPlayerUpdate
{
    if(
GetPlayerMoney(playerid) != PlayerInfo[playerid][cDinero]){
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,PlayerInfo[playerid][cDinero]);}
    if(
GetPlayerScore(playerid) != PlayerInfo[playerid][cAsesinatos]){
    
SetPlayerScore(playerid,PlayerInfo[playerid][cAsesinatos]);} 



Re: Problem in save - Spawe - 16.11.2018

UP HELP PLEASE


Re: Problem in save - Mencent - 16.11.2018

Hello!

Do you update the both variables?
Try this:
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
SendDeathMessage(killeridplayeridreason);
    
PlayerInfo[playerid][cDinero] += 400;//edit
    
PlayerInfo[playerid][cAsesinatos] += 1;//edit
    
SetPlayerScore(killerid,(GetPlayerScore(killerid))+1);
    
GivePlayerMoney(killerid400);
     new 
string[50];
    
format(stringsizeof(string), "~g~+$400");
    
GameTextForPlayer(killeridstring30001);
    return 
1;