#include <a_samp>forward ora();#if defined FILTERSCRIPTpublic OnFilterScriptInit(){SetTimer(\"ora\", 360000, 1);return 1;}public OnFilterScriptExit(){return 1;}#elsemain(){}public ora(){GetPlayerScore(1);return 1;}#endif
#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 file[128]; 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]);return 1;}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;}
#include a_sampforward Ora();public OnFIlterScriptInit(){SetTimer(\"Ora\", 60000*60, true);return 1;}public Ora(){for(new i; i <MAX_PLAYERS; i++){if(IsPlayerConnected(i)) SetPlayerScore(i, GetPlayerScore(i)+1);}return 1;}
Mokus, szerintem olyan kell neki ami az összesen eltelt idõt jelzi. Megcsináltam. #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]);return 1;}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;} Ha beírod hogy /oraim, kijelzi az eltelt idõd, ugyanakkor a pontodon is mutatja az óráid.E: A scriptfiles mappában legyen egy \"ido\" mappa.
#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]);return 1;}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;}
enum pAdat{Admin,As,Warn,Frakcio,ANev[25],Ora,Perc,MPerc,Munka,Regelve,Nem,Kor,Skin,Penz,Bun[25],Fegyver1,Fegyver2,Fegyver3,Fegyver4,Fegyver5,Fegyver6,Fegyver7,Fegyver8,Fegyver9,Fegyver10,Fegyver11,Tolteny3,Tolteny4,molouveg,molobenzin,molorongy,kespenge,Cella,Csatlakozhat,fegyverengedely,Setastilus,utott,Ero,Inteligencia,Bortonbe,Cigi}