09.03.2015, 13:52
Hey I would like to make a reaction tk points but that we preserve the name of the player and tk points it should be this way as a picture
PHP код:
switch(xTestBusy)
{
case true:
{
if(!strcmp(xChars, text, false))
{
//new
//string[456],
new pName[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "{FF0000}[TK]{FFFFFF}Najbrzi je bio {FF0000}%s\" {FFFFFF}i osvaja nagradu od $%d i sada ima {FF0000}%d {FFFFFF}TK POENA. »", pName,xCash,xScore);
SendClientMessageToAll(COLOR_GRAD1, string);
format(string, sizeof(string), "{00FFFF}« Dobili ste $%d»", xCash);
SendClientMessage(playerid, COLOR_GRAD1, string);
GivePlayerMoney(playerid, 1500);
//PlayerInfo[playerid][pExp] += 1;
SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
xReactionTimer = SetTimer("xReactionTest", TIMEE, 1);
xTestBusy = false;
//SavePlayer(playerid);
}
}
}
PHP код:
FUNCTION: xReactionTest()
{
new
xLength = (random(8) + 2),
string[128]
;
xCash = (random(574) + 228);
xScore = (random(1)+1);
format(xChars, sizeof(xChars), "");
Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))][0]);
format(string, sizeof(string), "{FF0000}[TK]{FFFFFF}Ko prvi upise u cetu {FF0000}%s{FFFFFF} dobija %d$. TRENUTNI REKORD: %i sek.", xChars, xCash, GetTimerInSeconds(GetTickCount()),xScore);
SendClientMessageToAll(PURPLE, string);
KillTimer(xReactionTimer);
xTestBusy = true;
SetTimer("xReactionProgress", 50000, 0);
return 1;
}