Problem in save
#1

-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]);} 
Reply
#2

UP HELP PLEASE
Reply
#3

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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)