19.03.2010, 11:58
Quote:
Originally Posted by Carlton
It's used to find a variable after a space. Like a command /ban <playerid>. It will not work if you do /ban5 ( Trying to ban id 5 ). So strtok finds the variable after a space so you can do /ban 5 ( Bans id 5 ). The parameters are explained like this ( in my way ):
const string[], &index The const string[] is to search a string and find a variable after the space, so like in OnPlayerCommandText, strtok looks for a space ( Like the example above /ban (THE SPACE) 5 ) after the command you put in. The &index is not something I don't understand 100%, but all I know is that it's used to store a random variable and it's needed for the function to run. I'll show you a strtok examples. pawn Код:
if(!strlen(ptext)) if = if !strlen(ptext) = The string text is 0. So if the string text is 0 then return that message. Translated If there's no space between @ and the message, then return that message Do you understand now? |