SA-MP Forums Archive
[Tutorial] [TUT] How to add additional entries in ErroR's registration system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TUT] How to add additional entries in ErroR's registration system (/showthread.php?tid=146246)



[TUT] How to add additional entries in ErroR's registration system - erorcun - 06.05.2010

Link to registration system: http://forum.sa-mp.com/index.php?topic=166203.0

This is very easy. Modes such as the Godfather can be edited easily with this feature.

If you do not have to "OnPlayerRegistered" callback, you must add one.

Making a Kills / Deaths saving:

Put in OnPlayerRegistered callback:
pawn Code:
AddIntInfo(username,"kills",0);
AddIntInfo(username,"deaths",0);
Put in OnPlayerDeath callback:
pawn Code:
new deaths, kills;
deaths = GetMemberStatsInt(GetPlayerUsername(playerid),"deaths");
kills = GetMemberStatsInt(GetPlayerUsername(killerid),"kills");
SetMemberStatsInt(GetPlayerUsername(playerid),"deaths",deaths+1);
SetMemberStatsInt(GetPlayerUsername(killerid),"kills",kills+1);
If you want to get kills/deaths:

pawn Code:
new kills,deaths;
kills = GetMemberStatsInt(GetPlayerUsername(playerid),"kills");
deaths = GetMemberStatsInt(GetPlayerUsername(playerid),"deaths");
Soon I will explain how to include my system to Godfather.