01.06.2017, 14:54
(
Последний раз редактировалось SeanDenZYR; 01.06.2017 в 15:31.
)
Whats wrong? when i do /barbets ig it wont work. help please.
Код:
// ChenChen143's Bar Betting Filterscript #define COLOR_WHITE 0xFFFFFFFF #include <a_samp> #include <zcmd> #include <sscanf2> #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Bar Bet Script by ChenChen143"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else #endif COMMAND:barbets(playerid, params[]) { new message[100]; new selection[25]; if(sscanf(params, "s[100]", message)) { SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Usage: \"barbets <bet-name>\""); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Bet Names: GrapeDrank($2,500), OrangeJuice($5,000), AppleJuice($10,000)"); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Bet Names: Coke($25,000), Pepsi($50,000), LightBeer($100,000), Beer($250,000)"); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Bet Names: RedWine($600,000), Champagne($1,200,000), Water($2,600,000)"); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Bet Names: Lemonade($4,100,000), Milkshake($8,700,000), Zonrox($13,000,000)"); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Bet Names: Domex($50,000,000), PepperDrink($75,000,000), Bleach($100,000,000)"); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Note: You will buy the drink, if you win, you get double the prize of the drink,"); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Note: If you lose, you get nothing. EXAMPLE: You bought PEPSI(50k) and you won,"); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SYNTAX] {FFFFFF}Note: You get 100k."); } else if(!strcmp(selection, "GrapeDrank", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 2500); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $5,000 from a bar bet!"); } case 3, 4, 5: { GivePlayerMoney(playerid, -2500); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "OrangeJuice", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 5000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $10,000 from a bar bet!"); } case 3, 4, 5: { GivePlayerMoney(playerid, -5000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "AppleJuice", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 10000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $20,000 from a bar bet!"); } case 3, 4, 5: { GivePlayerMoney(playerid, -10000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Coke", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 25000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $50,000 from a bar bet!"); } case 3, 4, 5: { GivePlayerMoney(playerid, -25000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Pepsi", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 50000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $100,000 from a bar bet!"); } case 3, 4, 5: { GivePlayerMoney(playerid, -50000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "LightBeer", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 100000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $200,000 from a bar bet!"); } case 3, 4, 5: { GivePlayerMoney(playerid, -100000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Beer", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 250000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $500,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $500,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -250000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "RedWine", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 600000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $1,200,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $1,200,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -600000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Champagne", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 1200000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $2,400,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $2,400,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -1200000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Water", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 2600000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $5,200,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $5,200,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -2600000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Lemonade", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 4100000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $8,200,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $8,200,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -4100000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Milkshake", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 8700000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $17,400,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $17,400,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -8700000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Zonrox", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 13000000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $26,000,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $26,000,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -13000000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "PepperDrink", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 75000000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $150,000,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $150,000,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -75000000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Domex", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 50000000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $100,000,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $100,000,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -50000000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, better luck next time!"); } } } else if(!strcmp(selection, "Bleach", true)) { new winchance = random(6); switch(winchance) { case 0, 1, 2: { GivePlayerMoney(playerid, 100000000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You have won $200,000,000 from a bar bet!"); new name[MAX_PLAYER_NAME]; new string[100]; GetPlayerName(playerid, name, sizeof(name)); format(message, sizeof(message), "{FF0000}[BROADCAST] {00FF04}%s Has Just Won $200,000,000 from a bar bet!",name); SendClientMessageToAll(COLOR_WHITE, string); } case 3, 4, 5: { GivePlayerMoney(playerid, -100000000); SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[BARBETS] {FFFFFF}You lost, Say GoodBye To your 100m!"); } } } return 1; }