03.04.2010, 12:38
Hello ... This is most often used for commands when you do not want to be abused ... eg. the order / money (/ money) and so on ... We have to show the order / money ....
Somewhere below the top let you include the following:
Somewhere below the top let you include the following:
Код:
new money [MAX_PLAYERS]; / / definition to add value to 1 to order Forward publicc (playerid) / / This is the definition of the public returns to 0 [/ code] You have to let this OnGameModeInitКод:SetTimer (publicc, 60000.1) / / timer for 1 minute .. (1.Minъta = 60000) [/ code] Now we have to OnPlayerCommandText command itselfКод:if (strcmp ("/ money" cmdtext, true, 10) == 0) ( if (cash [playerid] == 0) (/ / This is when the command has not been used during 1 minute can be used GivePlayerMoney (playerid, 15,000) / / Add $ 15,000 SendClientMessage (playerid, FARBA_ZLTA, "You gave your money") / / Message to add money cash [playerid] + = 1; / / This adds a value of 1 .. ie. that it is possible that the value of the command can be used up to 1 min. Else () SendClientMessage (playerid, COLOR_WHITE "command can be used until the 1st minute .."); / / This is a report which prints only when a player tries to use the command less than 1 minute .... ) return 1; ) [/ Code] Now somewhere in this fashion to giveКод:public publicc (playerid) / / This is a very public return to the value 0 in 1st minute .... ( cash [playerid] = 0, / / The return value 1minъtu 0th .. ie. The command can be used again. return 1; ) [/ Code]