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(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
SetPlayerScore(killerid,(GetPlayerScore(killerid))+1);
GivePlayerMoney(killerid, 400);
new string[50];
format(string, sizeof(string), "~g~+$400");
GameTextForPlayer(killerid, string, 3000, 1);
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(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[playerid][cDinero] += 400;//edit
PlayerInfo[playerid][cAsesinatos] += 1;//edit
SetPlayerScore(killerid,(GetPlayerScore(killerid))+1);
GivePlayerMoney(killerid, 400);
new string[50];
format(string, sizeof(string), "~g~+$400");
GameTextForPlayer(killerid, string, 3000, 1);
return 1;
}