19.02.2014, 18:21
Hello,
I am currently experiencing quite a large problem. It seems to happen both on the actual server and my localhost.
This is the code:
What happens is, I /setscore myself, make a NEW account and the score is on that account too. This is seriously confusing.
Any ideas?
Here is the relevant code for connecting:
The saving system I use is Y_INI. Any help would be appreciated.
I am currently experiencing quite a large problem. It seems to happen both on the actual server and my localhost.
This is the code:
pawn Код:
CMD:setscore(playerid, params[])
{
new playerb;
if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_RED, "invalid id/name");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Permissions.");
else
{
new score;
if(sscanf(params, "ui", playerb, score)) return SendClientMessage(playerid, COLOR_RED, "syntax");
SetPlayerScore(playerb, score);
PlayerInfo[playerb][pScore] = score;
}
return 1;
}
Any ideas?
Here is the relevant code for connecting:
pawn Код:
public OnPlayerConnect(playerid)
{
new score = PlayerInfo[playerid][pScore];
SetPlayerScore(playerid, score);