15.03.2016, 18:47
Hey guys, i am here with another problem. I am making a /jail command, i will explain you, what it should do:
When admin writes /jail [id] [amount of seconds] [reason], it should put player in some position.
Here is the command, i have made (it is not completed, couse i have no idea, how to complete it)
What i need, is to show a textdraw (which i have already made), in following format:
"Remaining time: %d minutes and %d seconds", so basically i want to get, from that time, which admin sets, seconds. I have no idea how to do it, maybe i need to use some divide, but i again have no idea how and where.
If some of you guys would be enable to help me and explain, what i need to do, i would rep you and be really, really thankful, couse this is one of the hardest thing, i have ever tryed to do.
When admin writes /jail [id] [amount of seconds] [reason], it should put player in some position.
Here is the command, i have made (it is not completed, couse i have no idea, how to complete it)
Код:
CMD:jail(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Zadanэ prнkaz neexistuje"); new pplayerid,reason[48],banmt[300],banma[300],string[128]; if(sscanf(params, "uis[48]", pplayerid,JailTime,reason)) return SendClientMessage(playerid, COLOR_RED, "Pouћitie /jail <id> <počet minъt 1-59> <dфvod>"); if(!IsPlayerConnected(pplayerid)) return SendClientMessage(playerid, COLOR_RED, "Hrбč nieje pripojenэ"); if(PlayerInfo[pplayerid][pJail] == 1) return SendClientMessage(playerid, COLOR_RED, "Hrбč je uћ na samotke"); switch(PlayerInfo[playerid][pAdmin]) { case 2: { format(banma,sizeof(banma),"Moderбtor %s na %d minъt uvдznil na samotku hrбča %s: %s",GetName(playerid),JailTime,GetName(pplayerid),reason); format(banmt,sizeof(banmt),"Moderбtor %s vбs na %d minъt uvдznil na samotku: %s",GetName(playerid), JailTime,reason); } case 3: { format(banma,sizeof(banma),"Administrбtor %s na %d minъt uvдznil na samotku hrбča %s: %s",GetName(playerid),JailTime,GetName(pplayerid),reason); format(banmt,sizeof(banmt),"Administrбtor %s vбs na %d minъt uvдznil na samotku: %s",GetName(playerid), JailTime,reason); } case 4: { format(banma,sizeof(banma),"Vedъci Administrбtor %s na %d minъt uvдznil na samotku hrбča %s: %s",GetName(playerid),JailTime,GetName(pplayerid),reason); format(banmt,sizeof(banmt),"Vedъci Administrбtor %s vбs na %d minъt uvдznil na samotku: %s",GetName(playerid), JailTime,reason); } case 5: { format(banma,sizeof(banma),"Hlavnэ Administrбtor %s na %d minъt uvдznil na samotku hrбča %s: %s",GetName(playerid),JailTime,GetName(pplayerid),reason); format(banmt,sizeof(banmt),"Hlavnэ Administrбtor %s vбs na %d minъt uvдznil na samotku: %s",GetName(playerid), JailTime,reason); } } SendClientMessageToAll(COLOR_RED,banma); SendClientMessage(pplayerid,COLOR_RED,banmt); PlayerInfo[pplayerid][pJail] = 1; SetPlayerPos(pplayerid, 279.7186,1815.9452,17.6406); SetPlayerFacingAngle(pplayerid, 91.7942); unjailplayer_timer[pplayerid] = SetTimerEx("UnjailPlayer",60000*JailTime,false,"i",pplayerid); return 1; }
"Remaining time: %d minutes and %d seconds", so basically i want to get, from that time, which admin sets, seconds. I have no idea how to do it, maybe i need to use some divide, but i again have no idea how and where.
If some of you guys would be enable to help me and explain, what i need to do, i would rep you and be really, really thankful, couse this is one of the hardest thing, i have ever tryed to do.