crear comando /tiempo
#10

pawn Код:
COMMAND:sancion(playerid,params[])
{
    if(GetPVarInt( playerid, "Level" ) > 0)
    {
        new pId, time;
        if(sscanf(params, "dds[128]", pId, time, params[3])) return SendClientMessage(playerid, 0xFF0000AA, "USO: /sancion [ID] [minutos] [razon]");
            else if(!IsPlayerConnected(pId)) return SendClientMessage(playerid, 0xFF0000AA, "Usuario no conectado");
                else
                {
                    new pname[MAX_PLAYER_NAME], jname[MAX_PLAYER_NAME], string1[250];
                    GetPlayerName(playerid, pname, sizeof(pname));
                    GetPlayerName(pId, jname, sizeof(jname));
                    SetPlayerInterior(pId, 3);
                    new rand = random(sizeof(JailCellSpawns));
                    SetPlayerVirtualWorld(pId,21);
                    SetPlayerPos(pId, JailCellSpawns[rand][0], JailCellSpawns[rand][1], JailCellSpawns[rand][2]);
                    SetTimerEx("UnJail",time*1000*60,0,"i",pId);
                    InJail[pId] = 1;
                    tiempo[playerid] = gettime()+(time*1000*60);
                    ResetPlayerWeapons(pId);
                    format(string1, sizeof(string1), "%s(%d) fue sancionado por un admin. Razon: %s", jname, pId, params[3]);
                    SendClientMessageToAll(COLOR_RED, string1);
                    //les saco el godmode
        SetPVarInt( pId, "God", 0);
        KillTimer( God[ pId ] );
        SetPlayerHealth( pId, 100.0 );
                    return 1;
                }
            }
            else
            {
                return 0;
            }
}



COMMAND:tiempo(playerid,params[])
{
    if(InJail[playerid] == 1)
    {
/*new str[128];
//format(str,sizeof(str),"te faltan %d segundos para salir de la carcel",gettime()-tiempo[playerid]);
//format(str,sizeof(str),"te faltan %d segundos para salir de la carcel",gettime());
format(str,sizeof(str),"Te faltan %d minutos para salir de la sancion",gettime()-tiempo[playerid]);
SendClientMessage(playerid,-1,str);*/

new str[128];
format(str,sizeof(str),"te faltan %d segundos para salir de la carcel",(tiempo[playerid]-gettime())/1000);
SendClientMessage(playerid,-1,str);
    }else{
                return 0;
    }
    return 1;
}
Код:
[13:27:30] a(0) fue sancionado. Razon: 9

[13:27:33] te faltan 539 segundos para salir de la carcel

[13:27:36] te faltan 539 segundos para salir de la carcel
Me encarcele 9minutos y dice eso
Reply


Messages In This Thread
crear comando /tiempo - by benjas09 - 14.05.2013, 22:22
Respuesta: crear comando /tiempo - by xSDx - 15.05.2013, 01:43
Respuesta: crear comando /tiempo - by benjas09 - 15.05.2013, 02:35
Respuesta: crear comando /tiempo - by benjas09 - 16.05.2013, 12:55
Respuesta: crear comando /tiempo - by JustBored - 16.05.2013, 14:24
Respuesta: crear comando /tiempo - by benjas09 - 16.05.2013, 14:44
Re: crear comando /tiempo - by Daniel-92 - 16.05.2013, 14:53
Respuesta: Re: crear comando /tiempo - by benjas09 - 16.05.2013, 15:42
Re: crear comando /tiempo - by Daniel-92 - 16.05.2013, 16:05
Respuesta: crear comando /tiempo - by benjas09 - 16.05.2013, 16:28

Forum Jump:


Users browsing this thread: 1 Guest(s)