#include <a_samp>#include <dini>#include <zcmd>#define COLOR_RED 0xFF0000FFnew fido_timer[MAX_PLAYERS];enum JatekosInfo{FOra,FPerc,FMPerc,}new PlayerTime[MAX_PLAYERS][JatekosInfo];new FIdo[MAX_PLAYERS][JatekosInfo];forward PlayedTime(playerid);forward Uzenet(playerid);public OnPlayerConnect(playerid){ new file[128];fido_timer[playerid] = SetTimerEx(\"tfido\", 1000, true, \"i\", playerid); if(!fexist(file)) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(file,sizeof(file),\"/Szerver/%s.ini\",name); if(!fexist(file)) { dini_Create(file); dini_IntSet(file, \"FMPerc\", 0); dini_IntSet(file, \"FPerc\", 0); dini_IntSet(file, \"FOra\", 0); } } if(fexist(file)) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(file,sizeof(file),\"/Szerver/%s.ini\",name); if(fexist(file)) { PlayerTime[playerid][FMPerc] = dini_Int(file, \"FMPerc\"); PlayerTime[playerid][FPerc] = dini_Int(file, \"FPerc\"); PlayerTime[playerid][FOra] = dini_Int(file, \"FOra\"); } } return 1;}public OnPlayerDisconnect(playerid, reason){ new file[128]; new name[MAX_PLAYER_NAME]; format(file,sizeof(file),\"%s.ini\",name); if(fexist(file)) { dini_IntSet(file, \"FMPerc\", PlayerTime[playerid][FMPerc]); dini_IntSet(file, \"FPerc\", PlayerTime[playerid][FPerc]); dini_IntSet(file, \"POra\", PlayerTime[playerid][FOra]); KillTimer(fido_timer[playerid]); } return 1;}forward tfido(playerid);public tfido(playerid){FIdo[playerid][FMPerc] ++;if(FIdo[playerid][FMPerc] == 60){ FIdo[playerid][FMPerc] = 0; FIdo[playerid][FPerc] ++; SendClientMessage(playerid, -1, \"Percet ugrottál!\"); } if(FIdo[playerid][FPerc] == 60) { FIdo[playerid][FMPerc] = 0; FIdo[playerid][FPerc] = 0; FIdo[playerid][FOra] ++; SendClientMessage(playerid, -1, \"Órát ugrottál!\"); }}CMD:stat(playerid, params[]){new fido[256];format(fido, sizeof(fido), \"|| Fent lévõ Óra: %02d | Perc: %02d | MásodPerc: %02d ||\", FIdo[playerid][FOra], FIdo[playerid][FPerc], FIdo[playerid][FMPerc]);SendClientMessage(playerid, -1, fido);return 1;}
dini_IntSet(file, \"POra\", PlayerTime[playerid][FOra]);
dini_IntSet(file, \"FOra\", PlayerTime[playerid][FOra]);
format(file,sizeof(file),\"%s.ini\",name);
format(file,sizeof(file),\"/Szerver/%s.ini\",name);
public tfido(playerid){ PlayerTime[playerid][FMPerc] ++; if(PlayerTime[playerid][FMPerc] == 60) { PlayerTime[playerid][FMPerc] = 0; PlayerTime[playerid][FPerc] ++; SendClientMessage(playerid, -1, \"Percet ugrottál!\"); } if(PlayerTime[playerid][FPerc]== 60) { PlayerTime[playerid][FMPerc]= 0; PlayerTime[playerid][FPerc] = 0; PlayerTime[playerid][FOra]++; SendClientMessage(playerid, -1, \"Órát ugrottál!\"); }}
szerintem meg csináld igy de nem biztos hogy ez a baj:) public tfido(playerid){ PlayerTime[playerid][FMPerc] ++; if(PlayerTime[playerid][FMPerc] == 60) { PlayerTime[playerid][FMPerc] = 0; PlayerTime[playerid][FPerc] ++; SendClientMessage(playerid, -1, \"Percet ugrottál!\"); } if(PlayerTime[playerid][FPerc]== 60) { PlayerTime[playerid][FMPerc]= 0; PlayerTime[playerid][FPerc] = 0; PlayerTime[playerid][FOra]++; SendClientMessage(playerid, -1, \"Órát ugrottál!\"); }}
new PlayerTime[MAX_PLAYERS][JatekosInfo];new FIdo[MAX_PLAYERS][JatekosInfo];
new FIdo[MAX_PLAYERS][JatekosInfo];