Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Ajutor la o comanda sa adaug deleay


Question

Posted

Salutare am o comanda sa intru la party in vw 1, si vreau ca playerii sa nu abuzeze de aceasta comanda si sa poata folosi comanda asta la un anumit nr. de minute.Un ajutor pls?

 

 

}
YCMD:enterparty(playerid, params[], help) {
    if(PlayerInfo[playerid][pAdmin] < 0) return SCM(playerid, COLOR_WHITE, AdminOnly);
    if(GetPlayerState(playerid) == 2) SetVehiclePosEx(playerid, GetPlayerVehicleID(playerid), 241.5090,-1821.7465,13.3);
    else SetPlayerPosEx(false, playerid, 241.5090,-1821.7465,13.3);
    SetPlayerInterior(playerid,0);
    InHQ[playerid] = -1;
    InHouse[playerid] = -1;
    InBussines[playerid] = -1;
    SetPlayerVirtualWorld(playerid,1);
    return true;
}

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

te folosesti de gettime() care returneaza unix timestamp-ul.

 

static playerCommandDelay[MAX_PLAYERS]; //global scope

 

YCMD:enterparty(playerid, params[], help) {
    if(PlayerInfo[playerid][pAdmin] < 0) return SCM(playerid, COLOR_WHITE, AdminOnly);

if(gettime() - playerCommandDelay[playerid] < (5 * 60)) return 1;
    if(GetPlayerState(playerid) == 2) SetVehiclePosEx(playerid, GetPlayerVehicleID(playerid), 241.5090,-1821.7465,13.3);
    else SetPlayerPosEx(false, playerid, 241.5090,-1821.7465,13.3);
    SetPlayerInterior(playerid,0);
    InHQ[playerid] = -1;
    InHouse[playerid] = -1;
    InBussines[playerid] = -1;
    SetPlayerVirtualWorld(playerid,1);

    playerCommandDelay[playerid] = gettime();
    return true;
}

 

 

Edited by Sancky

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.