10.02.2013, 19:33
(
Последний раз редактировалось aco_SRBIJA; 10.02.2013 в 20:06.
)
Well, I was making a register&login system with cini system (cessil's one) and I was seeing it is having some problems. I thought it was problem in cini but no. It simple made everytime deaths=0 what was false, because I used /kill few times. I was putting random numbers to save, and not my deads and it was working good. Password thing is geart working. I thought my vars are probs, so I did made new deads; puted under OnPlayerDeath deads++ and on register to add it to file and on disconnect to update it to file, with printing a number of deaths. Output was 0, I was wondering why, felt free to post here.
Code that I used to /kill:
tests after some time:
Used /kill 2 times, get output 2 times, all cool. Modify a bit and....
Output was 0.
What the hell is going on
Code that I used to /kill:
Код:
CMD:kill(playerid) { SetPlayerHealth(playerid,0.00); SendClientMessage(playerid,-1,#COL_RED"You have commited suicide!"); return 1; }
Код:
CMD:kill(playerid) { SetPlayerHealth(playerid,0.00); SendClientMessage(playerid,-1,#COL_RED"You have commited suicide!"); PlayerInfo[playerid][pDeaths]=PlayerInfo[playerid][pDeaths]+1; return 1; } public OnPlayerDisconnect(playerid, reason) { printf("========Deaths: %d=========",PlayerInfo[playerid][pDeaths]); cini_Update(playerid,"ddd","Admin",PlayerInfo[playerid][pAdmin],"Kills",PlayerInfo[playerid][pKills],"Deaths",PlayerInfo[playerid][pDeaths]); return 1; }
Код:
public OnPlayerDeath(playerid, killerid, reason) { PlayerInfo[playerid][pDeaths]=PlayerInfo[playerid][pDeaths]+1; // tried PlayerInfo[playerid][pDeaths]++; return 1; } CMD:kill(playerid) { SetPlayerHealth(playerid,0.00); SendClientMessage(playerid,-1,#COL_RED"You have commited suicide!"); return 1; } public OnPlayerDisconnect(playerid, reason) { printf("========Deaths: %d=========",PlayerInfo[playerid][pDeaths]); cini_Update(playerid,"ddd","Admin",PlayerInfo[playerid][pAdmin],"Kills",PlayerInfo[playerid][pKills],"Deaths",PlayerInfo[playerid][pDeaths]); return 1; }
What the hell is going on