Jump to content
  • 0

pomoc Help s timerem


Karel12

Dotaz

Zdravím potřeboval bych pomoci s timerem do mého Fs. Aby když ten příkaz napíšu abych ho mohl napsat znova až za určitý čas. A aby se napsalo: Tento příkaz lze použít 1x za XXXs 

 

#include <a_samp>
 
 
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/balicek", cmdtext, true, 1000) == 0)
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xFFFFFFFF,"
SendClientMessage(playerid,1,"{FFFFFF}( ! ) {FF0000}Vzal sis balíček {FFFFFF}!");
 
return 1;
}
return 0;
}
Link to comment
Share on other sites

3 odpovědí na tuto otázku

Recommended Posts

  • 0


if(strcmp("/balicek",cmdtext,true) == 0)
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Nejsi Admin");
    else if(0 < GetPVarInt(playerid,"Balicek") < gettime()) return SendClientMessage(playerid,-1,"Prikaz lze pouzit jednou za 60 vterin");
    /*else if(0 < GetPVarInt(playerid,"Balicek") < gettime())//alternativa
    {
        new string[128];
        format(string,sizeof(string),"Prikaz lze pouzit za %d vterin",gettime()-GetPVarInt(playerid,"Balicek"));
        return SendClientMessage(playerid,-1,string);
    }*/
    else
    {
        SetPVarInt(playerid,"Balicek",gettime()+60);//jednou za 60 vterin
        SendClientMessage(playerid,1,"{FFFFFF}( ! ) {FF0000}Vzal sis balíček {FFFFFF}!");
    }
    return 1;
}

 

Link to comment
Share on other sites

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...