22.04.2011, 00:31
This problem is really pissing me off, all the code looks perfect but it just doesn't work properly.
Basically if someone says a word in OnPlayerText, it sets a timer with a randomised phrase to be sent back to them:
Am I just overtired and missed something obvious?
Would appreciate replies thanks
Basically if someone says a word in OnPlayerText, it sets a timer with a randomised phrase to be sent back to them:
pawn Код:
public Reply(playerid, text[])
{
print(text); // this prints: "<null>"
new h, m, s;
gettime(h, m, s);
msgaF(WHITE, "reply string: {FFFFFF}%s", text);
printf("[%d:%d:%d] reply string: {FFFFFF}%s", h, m, s, text);
}
public OnPlayerText(playerid, text[])
{
if(strfind(text, "word", true)!=-1)
{
new r = random(sizeof(ReplyArray));
printf("random = %d, text to say = %s", r, ReplyArray[r]); // This prints the correct number and correct string
SetTimerEx("TalkSteve", 3000, false, "ds", playerid, ReplyArray[r]); // This all seems perfect, am I missing something?
}
Would appreciate replies thanks