26.02.2014, 16:23
pawn Код:
public OnPlayerText(playerid, text[])
{
if (strval(text) == MathQuizAnswer && MathQuizAnswer != -1)
{
MathQuizAnswered = 1;
MathQuizAnswer = -1;
SetTimer("MessageDelay", 500, false);
}
return 1;
}
forward MessageDelay(playerid);
public MessageDelay(playerid)
{
new randomprice = 2500 + (random(10) * 500);
new string[64+MAX_PLAYER_NAME+1];
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has answered the Math Quiz correctly and has won %d$!", name, randomprice);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
print(string);
GivePlayerMoney(playerid, randomprice);
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + randomprice;
}
What did I do wrong?