if(strcmp(cmdtext,"/cassino",true)==0) { SetPlayerPos(playerid,1133.5430,-14.8244,1000.6797); SetPlayerInterior(playerid,12); GameTextForPlayer(playerid,"Sala Admins",4000,6); return 1; } |
#include <a_samp> new SimbolosCassino[5][] = { {"{FFFF00}@{FFFFFF}"}, {"{777777}!{FFFFFF}"}, {"{FF0000}*{FFFFFF}"}, {"{0066FF}#{FFFFFF}"}, {"{009900}${FFFFFF}"} }; //------------------------------------------------------------------------------ public OnFilterScriptInit() { Create3DTextLabel("Use: /Apostar\nE tente ganhar {0066FF}2x{FFFFFF} seu {009900}dinheiro", 0xFFFFFFFF, 1119.291625, -1.769978, 1000.690551, 20.0, 0, true); Create3DTextLabel("Use: /Apostar\nE tente ganhar {0066FF}3x{FFFFFF} seu {009900}dinheiro", 0xFFFFFFFF, 1123.353881, -9.723221, 1002.085937, 20.0, 0, true); Create3DTextLabel("Use: /Apostar\nE tente ganhar {0066FF}5x{FFFFFF} seu {009900}dinheiro", 0xFFFFFFFF, 1118.191406, -4.278443, 1000.679687, 20.0, 0, true); Create3DTextLabel("Use: /Apostar\nE tente ganhar {0066FF}5x{FFFFFF} seu {009900}dinheiro", 0xFFFFFFFF, 1126.847778, -12.839473, 1002.085937, 20.0, 0, true); CreateObject(1832,1117.43994141,-4.00000000,1000.37219238,0.00000000,0.00000000,90. 00000000,600); CreateObject(1832,1117.43945312,-4.55999994,1000.37219238,0.00000000,0.00000000,90. 00000000,600); CreateObject(1836,1127.16503906,-13.48999977,1001.70178223,0.00000000,0.00000000,18 0.00000000,600); CreateObject(1851,1123.01049805,-8.34765053,1002.03582764,0.00000000,0.00000000,0.0 0000000,600); CreateObject(1852,1123.72058105,-8.88625336,1002.03582764,0.00000000,0.00000000,0.0 0000000,600); CreateObject(1953,1123.19995117,-12.19999981,1001.87402344,0.00000000,0.00000000,0. 00000000,600); CreateObject(1955,1123.19995117,-12.44999981,1002.07604980,70.00000000,270.00000000 ,180.00000000,600); CreateObject(3438,1133.19995117,-11.89999962,996.41998291,0.00000000,0.00000000,270 .00000000,600); return 1; } //------------------------------------------------------------------------------ public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[128], idx; cmd = strtok(cmdtext, idx); if(!strcmp("/apostar", cmd, true)) { new tmp[128]; if(IsPlayerInRangeOfPoint(playerid, 1.5, 1119.291625, -1.769978, 1000.690551)) { tmp = strtok(cmdtext, idx); if(!strval(tmp)) { SendClientMessage(playerid, 0x999999AA, "Use: /Apostar [Quantidade] [Numero]"); SendClientMessage(playerid, 0x999999AA, "Numeros: 1, 2, 5, 10 e 20"); return 1; } new Aposta = strval(tmp); if(Aposta < 1 || Aposta > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0x999999AA, "[ERRO] Vocк nгo tem esse dinheiro."); tmp = strtok(cmdtext, idx); if(!strval(tmp)) { SendClientMessage(playerid, 0x999999AA, "Use: /Apostar [Quantidade] [Numero]"); SendClientMessage(playerid, 0x999999AA, "Numeros: 1, 2, 5, 10 e 20"); return 1; } new Numero = strval(tmp); if(Numero != 1 && Numero != 2 && Numero != 5 && Numero != 10 && Numero != 20) return SendClientMessage(playerid, 0x999999AA, "[ERRO] Numero Invalido."); new n = random(5); new string[128]; switch(n) { case 0: { if(Numero == 1) { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 1. Vocк ganhou {009900}R$%d{FFFFFF}!", Aposta * 2); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, Aposta * 2); return 1; } else { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 1. Vocк perdeu {009900}R$%d{FFFFFF}.", Aposta); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, -Aposta); return 1; } } case 1: { if(Numero == 2) { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 2. Vocк ganhou {009900}R$%d{FFFFFF}!", Aposta * 2); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, Aposta * 2); return 1; } else { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 2. Vocк perdeu {009900}R$%d{FFFFFF}.", Aposta); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, -Aposta); return 1; } } case 2: { if(Numero == 5) { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 5. Vocк ganhou {009900}R$%d{FFFFFF}!", Aposta * 2); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, Aposta * 2); return 1; } else { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 5. Vocк perdeu {009900}R$%d{FFFFFF}.", Aposta); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, -Aposta); return 1; } } case 3: { if(Numero == 10) { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 10. Vocк ganhou {009900}R$%d{FFFFFF}!", Aposta * 2); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, Aposta * 2); return 1; } else { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 10. Vocк perdeu {009900}R$%d{FFFFFF}.", Aposta); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, -Aposta); return 1; } } default: { if(Numero == 20) { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 20. Vocк ganhou {009900}R$%d{FFFFFF}!", Aposta * 2); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, Aposta * 2); return 1; } else { format(string, sizeof(string), "[Info] {FFFFFF}O Numero foi: 20. Vocк perdeu {009900}R$%d{FFFFFF}.", Aposta); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, -Aposta); return 1; } } } } else if(IsPlayerInRangeOfPoint(playerid, 1.5, 1118.191406, -4.278443, 1000.679687) || IsPlayerInRangeOfPoint(playerid, 2.0, 1126.847778, -12.839473, 1002.085937)) { tmp = strtok(cmdtext, idx); if(!strval(tmp)) { SendClientMessage(playerid, 0x999999AA, "Use: /Apostar [Quantidade]"); return 1; } new Aposta = strval(tmp); if(Aposta < 1 || Aposta > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0x999999AA, "[ERRO] Vocк nгo tem esse dinheiro."); new s1 = random(sizeof(SimbolosCassino)); new s2 = random(sizeof(SimbolosCassino)); new s3 = random(sizeof(SimbolosCassino)); new string[128]; if(s1 == s2 && s2 == s3) { format(string, sizeof(string), "[Info] {FFFFFF}O Resultado da Maquina foi: %s | %s | %s. Vocк ganhou {009900}R$%d{FFFFFF}!", SimbolosCassino[s1], SimbolosCassino[s2], SimbolosCassino[s3], Aposta * 5); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, Aposta * 5); return 1; } else { format(string, sizeof(string), "[Info] {FFFFFF}O Resultado da Maquina foi: %s | %s | %s. Vocк perdeu {009900}R$%d{FFFFFF}.", SimbolosCassino[s1], SimbolosCassino[s2], SimbolosCassino[s3], Aposta); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, -Aposta); return 1; } } else if(IsPlayerInRangeOfPoint(playerid, 1.5, 1123.353881, -9.723221, 1002.085937)) { tmp = strtok(cmdtext, idx); if(!strval(tmp)) { SendClientMessage(playerid, 0x999999AA, "Use: /Apostar [Quantidade] [Numero 1] [Numero 2]"); SendClientMessage(playerid, 0x999999AA, "Numeros: {FFFFFF}Use nъmeros de 1 б 6."); return 1; } new Aposta = strval(tmp); if(Aposta < 1 || Aposta > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0x999999AA, "[ERRO] Vocк nгo tem esse dinheiro."); tmp = strtok(cmdtext, idx); if(!strval(tmp)) { SendClientMessage(playerid, 0x999999AA, "Use: /Apostar [Quantidade] [Numero 1] [Numero 2]"); SendClientMessage(playerid, 0x999999AA, "Numeros: {FFFFFF}Use nъmeros de 1 б 6."); return 1; } new n1 = strval(tmp); if(n1 < 1 || n1 > 6) return SendClientMessage(playerid, 0x999999AA, "[ERRO] Numero 1 Invalido."); tmp = strtok(cmdtext, idx); if(!strval(tmp)) { SendClientMessage(playerid, 0x999999AA, "Use: /Apostar [Quantidade] [Numero 1] [Numero 2]"); SendClientMessage(playerid, 0x999999AA, "Numeros: {FFFFFF}Use nъmeros de 1 б 6."); return 1; } new n2 = strval(tmp); if(n2 < 1 || n2 > 6) return SendClientMessage(playerid, 0x999999AA, "[ERRO] Numero 2 Invalido."); new d1 = random(6) + 1; new d2 = random(6) + 1; new string[128]; if(d1 == n1 && d2 == n2) { format(string, sizeof(string), "[Info] {FFFFFF}Os Numeros Foram: %d e %d. Vocк ganhou {009900}R$%d{FFFFFF}!", d1, d2, Aposta * 3); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, Aposta * 3); return 1; } else { format(string, sizeof(string), "[Info] {FFFFFF}Os Numeros Foram: %d e %d. Vocк perdeu {009900}R$%d{FFFFFF}.", d1, d2, Aposta); SendClientMessage(playerid, 0x009900AA, string); GivePlayerMoney(playerid, -Aposta); return 1; } } else { SendClientMessage(playerid, 0x999999AA, "[ERRO] Vocк nгo estб no Cassino."); return 1; } return 1; } return 0; } //------------------------------------------------------------------------------ stock strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } |
if(!strcmp("/cassino", cmd, true)) {
SetPlayerPos(playerid, 1133.5430, -14.8244, 1000.6797);
SetPlayerInterior(playerid, 12);
GameTextForPlayer(playerid, "Sala Admins", 4000, 6);
return 1;
}
Coloque isso acima de "/apostar":
PHP код:
|