14.12.2014, 01:42
The for loop is made to make the script check all Tele_CMD of pTele till the right one is found. If it wasnt for the for loop inside OnPlayerCommandPerformed, you would have to:
Its, infact, tiresome to script so many commands.. Now this makes your work easy as hell. To add a TP command, you can just add: {"cmdname".......VirtualWorld} to the bottom of the Array...
When do you make Enum+Array? Array can only hold one type of variable when it stands alone.. But with Enum, it becomes flexible.. It can store: Float, Integer, String, Bool, Timer, Text, PlayerText, etc with the help of ENUM.
In your case, the Enum makes space inside the Array from 0-15 for string, 16 for Tele_pos_x, etc.. Again, I am just saying it from what I KNOW, and I dont think am good enough to teach others.. Refer: https://sampforum.blast.hk/showthread.php?tid=318307
PHP код:
CMD:dm1(...)
{
setpos
}
CMD:dm2(...)
{
setpos
}
.
.
etc
.
When do you make Enum+Array? Array can only hold one type of variable when it stands alone.. But with Enum, it becomes flexible.. It can store: Float, Integer, String, Bool, Timer, Text, PlayerText, etc with the help of ENUM.
In your case, the Enum makes space inside the Array from 0-15 for string, 16 for Tele_pos_x, etc.. Again, I am just saying it from what I KNOW, and I dont think am good enough to teach others.. Refer: https://sampforum.blast.hk/showthread.php?tid=318307