PDA

View Full Version : help with onplayertext


HitterHitman
19/03/2014, 03:21 PM
This is my onplayertext

new pname[24];
new string[128];
new string2[128];
if(strfind(text, answer, true) && answered == 0)
{
GetPlayerName(playerid, pname, sizeof(pname));

format(string, sizeof(string), "'%s' has won with the correct answer '%d'.Rewards: +1000$ and +%d score!", pname, answer, score);
SendClientMessageToAll(green, string);
GivePlayerMoney(playerid, 1000);

answered = 1;
SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
score = 0;
return 1;
}

I have defined answer = 1; but it needs "1" at strfind how can i do this?

Matess
19/03/2014, 03:25 PM
Just define answer like string. And this: "correct answer '%d'" get from other variable not from player.