IchNar 0 Odesláno: 22. Listopad, 2014 Share Odesláno: 22. Listopad, 2014 Mám jeden problém.Mám jail ide mi to normálne len chcel by som tam pridať že keď bude vo väzení tak mu bude naboku písať kolko bude ešte vo väzení ako to spraviť?Vopred díky sa odpoveď. Tu je kód môjho jailu. ocmd:jail(playerid,params[]) { new id,minuty,string[128],duvod[128]; if(sscanf(params,"udz",id,minuty,duvod)) return SCM(playerid,COLOR_CERVENA,"Použi /jail [iD] [MINUTY] [DOVOD]"); else if(GetPVarInt(id,"Jail") == 1) return SCM(playerid,COLOR_CERVENA,"Hráč už je vo väzení"); else SetPVarInt(id,"Jail",1); SetTimerEx("Jail",minuty*60000,0,"i",id); SetPlayerInterior(id,3); SetPlayerPos(id,198.3796, 160.8905, 1003.03); format(string,sizeof(string),"Administrátor %s zatkol hráča %s na %d minut (%s)",Jmeno(playerid),Jmeno(id),minuty,duvod); SCMTA(COLOR_CERVENA,string); jevbase[id] = 1; return 1; } A ešte public: public Jail(playerid) { if(GetPVarInt(playerid,"Jail") ==1) { SetPVarInt(playerid,"Jail",0); GameTextForPlayer(playerid,"~r~ Odpykal si si trest! ~r~",10000,5); SetPlayerPos(playerid,1958.3783, 1343.1572, 15.3746); SetPlayerInterior(playerid,0); jevbase[playerid] = 0; } return true; } Link to comment Share on other sites More sharing options...
0 Mort 29 Odesláno: 22. Listopad, 2014 Share Odesláno: 22. Listopad, 2014 Můžeš to udělat třeba takto: SetTimerEx("Jail",1000,true,"i",id); // Každou vteřinu SetPVarInt(id, "JailSeconds", minuty * 60); A pak v tom timeru to uděláš takto: public Jail(playerid) { SetPVarInt(playerid, "JailSeconds", GetPVarInt(playerid, "JailSeconds") - 1); // tady napíšeš hráčovi, kolik mu ještě zbývá času ve vězení, to zjistíš takto: //GetPVarInt(playerid, "JailSeconds") // a pokud už si trest odpykal if(GetPVarInt(playerid, "JailSeconds") == 0) { // a zde ho vyšoupneš z vězení a vypneš timer } return 1; } Link to comment Share on other sites More sharing options...
0 IchNar 0 Odesláno: 22. Listopad, 2014 Author Share Odesláno: 22. Listopad, 2014 Moc nechápem kam to mám presne dať v tých mojich kódov,nemohol by si to čo si mi teraz napísal dať do mojich kódov?.Prosím Link to comment Share on other sites More sharing options...
0 Mort 29 Odesláno: 22. Listopad, 2014 Share Odesláno: 22. Listopad, 2014 new jailTimers[MAX_PLAYERS]; ocmd:jail(playerid,params[]) { new id,minuty,string[128],duvod[128]; if(sscanf(params,"udz",id,minuty,duvod)) return SCM(playerid,COLOR_CERVENA,"Použi /jail [ID] [MINUTY] [DOVOD]"); else if(GetPVarInt(id,"Jail") == 1) return SCM(playerid,COLOR_CERVENA,"Hráč už je vo väzení"); else { SetPVarInt(id,"Jail",1); jailTimers[id] = SetTimerEx("Jail",1000,true,"i",id); SetPVarInt(id, "JailSeconds", minuty * 60); SetPlayerInterior(id,3); SetPlayerPos(id,198.3796, 160.8905, 1003.03); format(string,sizeof(string),"Administrátor %s zatkol hráča %s na %d minut (%s)",Jmeno(playerid),Jmeno(id),minuty,duvod); SCMTA(COLOR_CERVENA,string); jevbase[id] = 1; } return 1; } public Jail(playerid) { SetPVarInt(playerid, "JailSeconds", GetPVarInt(playerid, "JailSeconds") - 1); if(GetPVarInt(playerid, "JailSeconds") == 0) { SetPVarInt(playerid,"Jail",0); GameTextForPlayer(playerid,"~r~ Odpykal si si trest! ~r~",10000,5); SetPlayerPos(playerid,1958.3783, 1343.1572, 15.3746); SetPlayerInterior(playerid,0); jevbase[playerid] = 0; KillTimer(jailTimers[playerid]); } else { new str[128]; format(str, 128, "Zbývá ti ještě %d sekund ve vězení!", GetPVarInt(playerid, "JailSeconds")); SendClientMessage(playerid, -1, str); } return 1; } Link to comment Share on other sites More sharing options...
0 IchNar 0 Odesláno: 22. Listopad, 2014 Author Share Odesláno: 22. Listopad, 2014 Dííky,moc .Už funguje všetko ako mý,môžte LOCK. Link to comment Share on other sites More sharing options...
Dotaz
IchNar 0
Mám jeden problém.Mám jail ide mi to normálne len chcel by som tam pridať že keď bude vo väzení tak mu bude naboku písať kolko bude ešte vo väzení ako to spraviť?Vopred díky sa odpoveď.
Tu je kód môjho jailu.
Link to comment
Share on other sites
4 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now