#1

how can i add a timer off 5 min on this cmd
so you can only use it in 5 minutes

pawn Код:
if(strcmp(cmd, "/hackpolice", true) == 0 && IsPlayerConnected(playerid))
    {
        if(PlayerToPoint(3.0, playerid, 2290.2595,2430.9697,10.8203) && PlayerInfo[playerid][pRank] >= -1 && IsPlayerConnected(playerid))
        {
            {
            GivePlayerMoney(playerid,5000);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "%s Has Hacked The police",sendername);
            SendClientMyessageToAll(COLOR_RED, string);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "YOU ARE NOT A HAXOR");
        }
        return 1;
    }
Reply
#2

SetTimerEx("HeliCMD",(((5*10)*10)*10),false,"i",pl ayerid);

public HeliCMD();

public HeliCMD(){
//command code
return 1;
}
Reply
#3

Don't make the computer do calculations that you can do
300000 miliseconds = 5 minutes.
Reply
#4

Quote:
Originally Posted by David.
SetTimerEx("HeliCMD",(((5*10)*10)*10),false,"i",pl ayerid);

public HeliCMD();

public HeliCMD(){
//command code
return 1;
}
omg thats not what i need
i need that in my cmd because i am a noob scripter
Reply
#5

can some one help me ?
Reply
#6

pawn Код:
//top
new CanUse[MAX_PLAYERS];

//onplayercommandtext
if(strcmp(cmd, "/hackpolice", true) == 0 && IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0, playerid, 2290.2595,2430.9697,10.8203) && PlayerInfo[playerid][pRank] >= -1 && IsPlayerConnected(playerid))
 {
   if(CanUse[playerid] == 1)

{
GivePlayerMoney(playerid,5000);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Has Hacked The police",sendername);
SendClientMyessageToAll(COLOR_RED, string);
CanUse[playerid] = 0;
SetTimerEx("AbleToUse", 300000, 0, "i", playerid);
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "YOU ARE NOT A HAXOR");
}
return 1;
}

//bottom
forward AbleToUse(playerid);
public AbleToUse(playerid)
{
  CanUse[playerid] = 1;
}
Reply
#7

ehmm
i tested it
if i want to compile it
my pawno crashes
please show how many tabs and there most be
like my first post!!!!!!!!!!!
Reply
#8

ehmm
i tested it
if i want to compile it
my pawno crashes
please show how many tabs and there most be
like my first post!!!!!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)