#include <a_samp> #include <dini> #define COR_AQUI 0xFFFFFFAA new Level[MAX_PLAYERS]; new Respeito[MAX_PLAYERS]; public OnPlayerConnect(playerid) { if(dini_Isset("levels.dkn",PlayerName(playerid))) Level[playerid] = (playerid,dini_Int("levels.dkn",PlayerName(playerid))); SetTimerEx("Timer",60000,true,"i",playerid); return 1; } forward Timer(playerid); public Timer(playerid) { Respeito[playerid]++; SendClientMessage(playerid,COR_AQUI,"Gratz,your respect has grown a bit more!!"); if(Respeito[playerid] == 5) { Level[playerid]++; SendClientMessage(playerid,COR_AQUI,"Gratz,you leveled up!!"); Level[playerid]++; } return 1; } public OnGameModeInit() { if(!fexist("levels.dkn")) dini_Create("levels.dkn"); return 1; } public OnPlayerDisconnect(playerid, reason) { dini_IntSet("levels.dkn",PlayerName(playerid),Level[playerid]); return 1; } public OnPlayerUpdate(playerid) { dini_IntSet("levels.dkn",PlayerName(playerid),Level[playerid]); if(dini_Isset("levels.dkn",PlayerName(playerid))) SetPlayerScore(playerid,dini_Int("levels.dkn",PlayerName(playerid))); return 1; } stock PlayerName(playerid) { new PlayerNameLevel[MAX_PLAYERS]; GetPlayerName(playerid, PlayerNameLevel, MAX_PLAYERS); return PlayerNameLevel; }
Level[playerid]++;
SendClientMessage(playerid,COR_AQUI,"Gratz,you leveled up!!");
Level[playerid]++;
Level[playerid]++;
SendClientMessage(playerid,COR_AQUI,"Gratz,you leveled up!!");
public Timer(playerid)
{ Respeito[playerid]++; SendClientMessage(playerid,COR_AQUI,"Gratz,your respect has grown a bit more!!"); if(Respeito[playerid] == 5) { Level[playerid]++; SendClientMessage(playerid,COR_AQUI,"Gratz,you leveled up!!"); Level[playerid]++; } return 1; } |
forward Timer(playerid);
public Timer(playerid)
{
Respeito[playerid]++;
SendClientMessage(playerid,COR_AQUI,"Gratz,your respect has grown a bit more!!");
if(Respeito[playerid] == 5)
{
SendClientMessage(playerid,COR_AQUI,"Gratz,you leveled up!!");
Level[playerid]++;
}
return 1;
}
#include <a_samp>
#include <dini>
#define COR_AQUI 0xFFFFFFAA
new Level[MAX_PLAYERS];
new Respeito[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
if(dini_Isset("levels.dkn",PlayerName(playerid))) Level[playerid] = (playerid,dini_Int("levels.dkn",PlayerName(playerid)));
SetTimerEx("Timer",60000,true,"d",playerid);
return 1;
}
forward Timer(playerid);
public Timer(playerid)
{
Respeito[playerid]++;
SendClientMessage(playerid,COR_AQUI,"Gratz,your respect has grown a bit more!!");
if(Respeito[playerid] == 5)
{
SendClientMessage(playerid,COR_AQUI,"Gratz,you leveled up!!");
}
return 1;
}
public OnGameModeInit()
{
if(!fexist("levels.dkn")) dini_Create("levels.dkn");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
dini_IntSet("levels.dkn",PlayerName(playerid),Level[playerid]);
return 1;
}
public OnPlayerConnect(playerid)
{
dini_IntSet("levels.dkn",PlayerName(playerid),Level[playerid]);
if(dini_Isset("levels.dkn",PlayerName(playerid))) SetPlayerScore(playerid,dini_Int("levels.dkn",PlayerName(playerid)));
return 1;
}
stock PlayerName(playerid)
{
new PlayerNameLevel[MAX_PLAYERS];
GetPlayerName(playerid, PlayerNameLevel, MAX_PLAYERS);
return PlayerNameLevel;
}