10.07.2015, 11:38
I'm probably doing some bad mistake here... not sure where.. but it's not setting the credits amount on death. It's setting the kills and deaths, but just not the credits.
I can however set the credits with a test command that I made here
That one changed the credits amount, when I view the credits here in another test command:
It's just frustrating because I've tried a lot of things and it's the smallest bug ever 0_0 and I can't progress without fixing it.
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[killerid][pKills] ++;
PlayerInfo[playerid][pDeaths] ++;
PlayerInfo[killerid][pCredits] = PlayerInfo[killerid][pCredits] + 3;
PlayerInfo[playerid][pCredits] --;
return 1;
}
Код:
COMMAND:byecredits(playerid, params[])
{
PlayerInfo[playerid][pCredits] --;
return 1;
}
Код:
COMMAND:credits(playerid, params[])
{
new string[20];
format(string, sizeof(string), "%d",PlayerInfo[playerid][pCredits]);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "%d",PlayerInfo[playerid][pDeaths]);
SendClientMessage(playerid, -1, string);
return 1;
}


