16.08.2010, 18:55
>>> Before you read and start saying this is a GF script, please don't. The script is inspired by the Godfather saving/storing systems, which looks pretty same as in the GF in my script. So: It's not a GF script (!) <<<
Hey there, I got this weird problem.
I made a function that bans people named BanX(playerid, by(who you got banned by), reason, bool: silent)
The function looks as following:
Example of use:
The two lines here
PlayerInfo[playerid][pBans] += 1;
PlayerInfo[playerid][pBanned] = 1;
Does not work, or apply. The playerid's file doesnt get the values saved.
I have checked the code that saves/loads the values, it's nothing wrong there. It's all correct. And should work.
So to double check that that it really didn't work I made a command like /testban that just applied those two lines I showed to you.
When I ran the command in game, the values saved and stored. So now is the question, what is wrong? Why doesn't those values do the same as in /testban at the BanX() function ?
Do you have any ideas?
Hey there, I got this weird problem.
I made a function that bans people named BanX(playerid, by(who you got banned by), reason, bool: silent)
The function looks as following:
pawn Код:
public BanX(playerid, by[], reason[], bool:silent)
{
if(IsPlayerConnected(playerid))
{
new string[256];
new sendername[MAX_PLAYERS];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(strcmp(by, "nill", true) == 0)
{
format(string, sizeof(string), "AdmCmd: %s was banned [Reason: %s]", sendername, reason);
}
else
{
format(string, sizeof(string), "AdmCmd: %s was banned by %s [Reason: %s]", sendername, by, reason);
}
if(!silent) { OOCNews(COLOR_LIGHTRED, string); }
PlayerInfo[playerid][pBans] += 1;
PlayerInfo[playerid][pBanned] = 1;
OnPlayerUpdate(playerid);
printf(string);
BanLog(string);
Ban(playerid);
}
}
pawn Код:
BanX(i, "ANTI-CHEAT", "Weapon Hack", false);
PlayerInfo[playerid][pBans] += 1;
PlayerInfo[playerid][pBanned] = 1;
Does not work, or apply. The playerid's file doesnt get the values saved.
I have checked the code that saves/loads the values, it's nothing wrong there. It's all correct. And should work.
So to double check that that it really didn't work I made a command like /testban that just applied those two lines I showed to you.
When I ran the command in game, the values saved and stored. So now is the question, what is wrong? Why doesn't those values do the same as in /testban at the BanX() function ?
Do you have any ideas?