Level FS - 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: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Level FS (
/showthread.php?tid=268084)
Level FS -
Anzhelov - 11.07.2011
I've searched here in the forums, but couldn't find anything. Can anyone help me? I'm trying to find Level System for RP servers. For example hours playing = your score or something like that.
Re: Level FS -
Kayaque - 11.07.2011
Here's something I threw together for you, using PVar.
pawn Код:
OnPlayerConnect(playerid)
{
Level[playerid] = SetTimerEx("LevelTimer", 60000, true, "i", playerid);
printf("Leveltimer for %s has started", whatever format you use for name);
return 1;
}
forward LevelTimer(playerid);
public LevelTimer(playerid)
{
if(GetPVarInt(playerid, "Level") < 60)
{
SetPVarInt(playerid, "Level", GetPVarInt(playerid, "Level") + 1);
}
else if(GetPVarInt(playerid, "Level") == 60)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
DeletePVar(playerid, "Level");
SendClientMessage(playerid, 0xFFFFFFAA, "You have leveled up for being online an hour!");
}
return ;
}
This is not tested at any means, so feel free to edit whatnot you might think of.
- KayaQue.