#include <a_samp>#include <dini>#include <zcmd>new file[128];enum Info{ orak, percek, mpercek}new pInfo[MAX_PLAYERS][info];new timerke[MAX_PLAYERS];public OnFilterScriptInit(){ print(\"\\n--------------------------------------\"); print(\" Eltoltott ido script by Rupert\"); print(\"--------------------------------------\\n\"); return 1;}public OnFilterScriptExit(){ print(\"Script bezarva. (Eltoltott ido)\"); return 1;}public OnPlayerDisconnect(playerid, reason){ KillTimer(timerke[playerid]); new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(file,128,\"/ido/%s.ini\",name); dini_IntSet(file,\"Orak\",pInfo[playerid][orak]); dini_IntSet(file,\"Percek\",pInfo[playerid][percek]); dini_IntSet(file,\"Mpercek\",pInfo[playerid][mpercek]);}public OnPlayerSpawn(playerid){ new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(file,128,\"/ido/%s.ini\",name);if(!dini_Exists(file)) { dini_Create(file); dini_IntSet(file,\"Orak\",0); dini_IntSet(file,\"Percek\",0); dini_IntSet(file,\"Mpercek\",0); pInfo[playerid][orak] = dini_Int(file,\"Orak\"); pInfo[playerid][percek] = dini_Int(file,\"Percek\"); pInfo[playerid][mpercek] = dini_Int(file,\"Mpercek\"); } else { pInfo[playerid][orak] = dini_Int(file,\"Orak\"); pInfo[playerid][percek] = dini_Int(file,\"Percek\"); pInfo[playerid][mpercek] = dini_Int(file,\"Mpercek\"); } timerke[playerid] = SetTimerEx(\"toltottorak\",1000,1,\"i\",playerid); SetPlayerScore(playerid,pInfo[playerid][orak]); return 1;}public OnPlayerUpdate(playerid){ SetPlayerScore(playerid,pInfo[playerid][orak]);}forward toltottorak(playerid);public toltottorak(playerid){ pInfo[playerid][mpercek]++; if(pInfo[playerid][mpercek] == 59) { pInfo[playerid][mpercek] = 0; pInfo[playerid][percek]++; if(pInfo[playerid][percek] == 59 && pInfo[playerid][mpercek] == 59) { pInfo[playerid][percek] = 0; pInfo[playerid][mpercek] = 0; pInfo[playerid][orak]++; new str[128]; format(str,128,\"Eltelt az eltelt idõidben egy óra! Játszott óráid: %i\",pInfo[playerid][orak]); SendClientMessage(playerid,-1,str); } } return 1;}CMD:oraim(playerid,params[]){ new str[128]; format(str,128,\"Játszott óráid: %i óra, %i perc és %i másodperc.\",pInfo[playerid][orak],pInfo[playerid][percek],pInfo[playerid][mpercek]); SendClientMessage(playerid,-1,str); return 1;}
format(file,128,\"/ido/%s.ini\",name) if(!dini_Exists(file)) { dini_Create(file); dini_IntSet(file,\"Orak\",0); dini_IntSet(file,\"Percek\",0); dini_IntSet(file,\"Mpercek\",0); pInfo[playerid][orak] = dini_Int(file,\"Orak\"); pInfo[playerid][percek] = dini_Int(file,\"Percek\"); pInfo[playerid][mpercek] = dini_Int(file,\"Mpercek\");
pInfo[playerid][(valtozo)] = 0;
Óránként kijelzi hogy eltelt egy óra, és hogy ennyi meg ennyi.De meg tudod nézni a pontos eltöltött idõt az /oraim paranccsal. [/quote]oksam!!:DD cak most sajnos nem jó a gépem :S