12.05.2009, 11:48
Well the count bit itself is fairly simple, but to save it requires some additional parts.
The above script will only work for a single session and each time you restart the script it'll be back to 0. Now you have a choice of how you wish to save your variables. You can use fwrite() to create your own saving system, or use one that is already set-up like DJSon or Dini (both by Dracoblue). You could also use Dudb, but it would be a bit of a shame to create a file for every player that only contains 1 variable...
pawn Code:
new Count[MAX_PLAYERS];
new string[128];
pawn Code:
if (strcmp("/count", cmdtext, true, 6) == 0)
{
Count[playerid]++;
format(string, sizeof(string), "You have counted %d times", Count[playerid]);
SendClientMessage(playerid, 0xFF00FFFF, string);
return 1;
}