28.05.2015, 00:34
Lo que pasa es que estoy tratando de instalar un sistema de ejemplo:
"El primero en escribir KJAS9das8zxl ganara 29000$ y 5 Score"..
Y Sale el mensaje y todo pero al escribir la frase no me da ni el dinero ni el Score...
Aquн estбn las lineas, a ver si alguien me dice que esta mal..
Primero tenemos el new:
Despuйs el siguiente cуdigo:
Despuйs la funciуn:
Esto estaba en GameModeInit, Supongo yo que es tambien del codigo porque arriba en la funcion esta.
Espero que me puedan ayudar.
"El primero en escribir KJAS9das8zxl ganara 29000$ y 5 Score"..
Y Sale el mensaje y todo pero al escribir la frase no me da ni el dinero ni el Score...
Aquн estбn las lineas, a ver si alguien me dice que esta mal..
Primero tenemos el new:
PHP код:
new
xCharacters[][] =
{
"A", "B", "C", "D", "E", "F", "G", "H", "*", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "_", "m",
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
},
xChars[16] = "",
xReactionTimer,
xCash,
xScore,
bool: xTestBusy
;
PHP код:
if(!strcmp(xChars, text, false))
{
new string[128],NameNick[MAX_PLAYER_NAME];
GetPlayerName(playerid, NameNick, sizeof(NameNick));
format(string, sizeof(string), "« {ffffff}' \%s ' {00FFFF}es el ganador del test de reacciуn »", NameNick);
SendClientMessageToAll(0x00FFFFAA, string);
format(string, sizeof(string), "« Tu has ganado $%d + %d de score »", xCash, xScore);
SendClientMessage(playerid, 0x00FF00C8, string);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GameTextForPlayer(playerid, "~y~winner~n~~p~Premio Obtenido", 3000, 3);
GivePlayerMoney(playerid, xCash);
SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
SavePlayer(playerid);
#if defined USE_STATS
PlayerInfo[playerid][Kills] = PlayerInfo[playerid][Kills]+ xScore;
#endif
xReactionTimer = SetTimer("xReactionTest", TIME, 1);
xTestBusy = false;
}
}
}
return 1;
}
PHP код:
function xReactionTest()
{
new
xLength = (random(8) + 5),
string[128]
;
xCash = (random(10000) + 20000);
xScore = (random(2)+4);
format(xChars, sizeof(xChars), "");
Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))][0]);
format(string, sizeof(string), "[Test]: {00FFFF}Quien sea el primero en escribir{FFFFFF} %s {00FFFF}ganara $%d +%d de score", xChars, xCash, xScore);
SendClientMessageToAll(0xFFFFFFAA, string);
KillTimer(xReactionTimer);
xTestBusy = true;
// SetTimer("xReactionProgress", 50000, 0);
return 1;
}
PHP код:
xReactionTimer = SetTimer("xReactionTest", TIME, 1);