31.03.2012, 19:29
pawn Код:
if(strcmp(cmd, "/bilhete", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(5.0, playerid,822.1683,2.8630,1004.1797))
{
if(PlayerInfo[playerid][pLottoNr] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк jб tem um bilhete de loteria !");
return true;
}
if(GetPlayerGP(playerid) < 100)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк precisa de R$100 para comprar um Bilhete!");
return true;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE,"USE: /bilhete [nъmero]");
return true;
}
new lottonr = strval(tmp);
if(lottonr < 1 || lottonr > 80) { SendClientMessage(playerid, COLOR_GREY, " O nъmero deve ser entre 1 a 80!"); return 1; }
format(string, sizeof(string), "Vocк comprou um bilhete lotйrico com nъmero %d.", lottonr);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerGP(playerid, - 100);
PlayerInfo[playerid][pLottoNr] = lottonr;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб na Lotйrica !");
}
return true;
}