#1

Hi Guys i want Counvert two Cmds (/jail /mute) it's /jail id Min reason and same for Mute
i Don't want Min i want Second any 1 can Convert it please
PHP код:
CMD:jail(playerid,params[])
{
    if(
PlayerInfo[playerid][Admin] < 2) return SendClientMessage(playeridCOLOR_RED"You need to be level 3 to use this command!");
    {
        new 
pIdtime;
        if(
sscanf(params"dds"pIdtimeparams[3])) return SendClientMessage(playeridCOLOR_RED"Usage: /jail (ID) (Time In Minuets) (Reason)");
        else if(!
IsPlayerConnected(pId)) return SendClientMessage(playeridCOLOR_RED"Invalid ID");
        else if(
PlayerInfo[pId][Jailed] == 1) return SendClientMessage(playeridCOLOR_RED"Player is already in jail");
        else
        {
            new 
pname[MAX_PLAYER_NAME], jname[MAX_PLAYER_NAME], string1[250];
            
GetPlayerName(playeridpnamesizeof(pname));
            
GetPlayerName(pIdjnamesizeof(jname));
            
SetPlayerInterior(pId6);
            
SetPlayerVirtualWorld(pId10);
            
SetPlayerPos(pId264.1542,77.6009,1001.0391);
            
SetTimerEx("UnJail",time*1000*60,0,"i",pId);
            
ResetPlayerWeapons(pId);
            
PlayerInfo[pId][Jailed] = 1;
            
format(string1sizeof(string1), "Admin %s(%d) has  jailed you for %d minutes; Reason: %s"GetPlayerNameEx(playerid), pIdtimeparams);
            
SendClientMessage(pId,0x00D9ADFFstring1);
        }
    }
    return 
1;
}
CMD:mute playeridparams[] )
{
    if(
PlayerInfo[playerid][Admin] < 3) return SendClientMessage(playeridCOLOR_RED"You need to be level 3 to use this command!");
    {
        new 
pIdtime;
        if(
sscanf(params"dds"pIdtimeparams[3])) return SendClientMessage(playeridCOLOR_RED"Usage: /mute (ID) (Time In Minuets) (Reason)");
        else if(!
IsPlayerConnected(pId)) return SendClientMessage(playeridCOLOR_RED"Invalid ID");
        else if(
PlayerInfo[pId][Muted] == 1) return SendClientMessage(playeridCOLOR_RED"Player is already Muted");
        else
        {
            new 
pname[MAX_PLAYER_NAME], jname[MAX_PLAYER_NAME], string1[250];
            
GetPlayerName(playeridpnamesizeof(pname));
            
GetPlayerName(pIdjnamesizeof(jname));
            
SetTimerEx("UnMute",time*1000*60,0,"i",pId);
            
PlayerInfo[pId][Muted] = 1;
            
format(string1sizeof(string1), "Admin %s(%d) has  Muted you for %d minutes; Reason: %s"GetPlayerNameEx(playerid), pIdtimeparams);
            
SendClientMessage(pId,0x00D9ADFFstring1);
        }
    }
    return 
1;

Reply
#2

That *60 in your timers means it's on minutes, if you want to use seconds, simply use time*1000, remove the *60 part
PHP код:
SetTimerEx("UnJail",time*1000*60,0,"i",pId); 
Reply
#3

yeah you need to remove *60 from

PHP код:
SetTimerEx("UnJail",time*1000*60,0,"i",pId); 
and

PHP код:
SetTimerEx("UnMute",time*1000*60,0,"i",pId); 
Reply
#4

Work thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)