14.09.2012, 14:59
Hello,
im using SetTimerEx to count 1 second and set a timer for my leveling system.
But the timer works only for one player. If i connect on the server, it work for me.
But if anyone join on the server and he looks to his own timer, it not work.
I will for ever player a counter to safe theri skill data
WHat is false?
im using SetTimerEx to count 1 second and set a timer for my leveling system.
But the timer works only for one player. If i connect on the server, it work for me.
But if anyone join on the server and he looks to his own timer, it not work.
I will for ever player a counter to safe theri skill data
WHat is false?
Код:
public OnGameModeInit() { new playerid[MAX_PLAYERS]; SetTimerEx("TimeOnServer", 1000, true, "i", playerid); ....
Код:
forward TimeOnServer(playerid); public TimeOnServer(playerid) { SpielerInfo[playerid][pPlayerTimeSec] ++; if(SpielerInfo[playerid][pPlayerTimeSec]>=60) { SpielerInfo[playerid][pPlayerTimeSec]=0; SpielerInfo[playerid][pPlayerTimeMin]++; } if(SpielerInfo[playerid][pPlayerTimeMin]>=60) { SpielerInfo[playerid][pPlayerTimeMin]=0; SpielerInfo[playerid][pPlayerTimeHour]++; SpielerInfo[playerid][pSkill]++; PlayerPlaySound(playerid,1149,0,0,0); SendClientMessage(playerid, red, "[SKILL] {FFFFFF}Du hast +1 Skillpunkt erhalten"); } if(SpielerInfo[playerid][pPlayerTimeHour]>=24) { SpielerInfo[playerid][pPlayerTimeHour]=0; SpielerInfo[playerid][pPlayerTimeDay]++; } if(SpielerInfo[playerid][pSkill]>=10) { SpielerInfo[playerid][pSkill]=0; SpielerInfo[playerid][pLevel]++; SendClientMessage(playerid, red, "[SKILL] {FFFFFF}Du hast +1 Level erhalten"); } }