[ Tutorial ] Commands Time
#1

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:

Код:
 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]
Reply
#2

hey man whats your problem
Reply
#3

Um... i didnt get this
Reply
#4

Quote:
Originally Posted by Winded
Um... i didnt get this
Instead of making a tut maybe he made something to mae us confuse...
it too confusing can't understand..
Reply
#5

guys he meant not abusing a command , but he have done it completely wrong , he set the timer under OnGameModeInit which would make nothing related to the command...
Reply
#6

wtf! This code is stupid!! Author teach basics scripting!

Код:
cash [playerid] + = 1;
what is this nonsense?
That's the way cash [playerid] = 1;

Lesson stupid.Many Errors.

First, You taught yourself and then teach others!
Reply
#7

What is "1 Minuta"?
Reply
#8

This tutorial will leave everyone who uses it with errors,
And it wont work anyway, You cant use SetTimer,
As you need to use SetTimerEx for this type of stuff,
But as i said, This tutorial will leave everyone who uses it with errors and wont work..
You can find a working one in my signature!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)