I have a BUG using this plugin, when the player types! Given he rolls the dice and wins something, only he has moments that even he dies or starting the next round the privileges he won by rolling the dice continues.
For example, he wins drugs, he dies or starts a new round and he's still on drugs and he can roll the dice again and accumulate the new privilege with what he already is, which would be the drug.
Can someone make a version for the Store by Zephyrus?
please?
Quote:
Originally Posted by Cruze
Zephyrus Store version of this? What all features are you expecting?
I believe he did not explain it right...
From what I saw in the plugin he has the option to buy the dice, I think it would be interesting that instead of the game's own money he buys the dice with the credits from the store.
From what I saw in the plugin he has the option to buy the dice, I think it would be interesting that instead of the game's own money he buys the dice with the credits from the store.
Would it be this?
just edited 3 lines at work. so I havn't test it, but should work.
new Handle:c_DiceText;
new Handle:c_ShowNumber;
new Handle:c_RandNumber;
new Handle:c_DiceTeam;
new Handle:c_DiceCount;
new Handle:c_DiceMoney;
new String:DiceText[64];
new ShowNumber;
new RandNumber;
new DiceTeam;
new DiceMoney;
new DiceCount;
new friction_default = -1;
new accelerate_default = -1;
new NoclipCounter[MAXPLAYERS + 1];
new ClientDiced[MAXPLAYERS + 1];
new FroggyJumped[MAXPLAYERS + 1];
new fire[MAXPLAYERS + 1];
new bool:EnabledNumbers[DICES+1];
new bool:LongJump[MAXPLAYERS + 1];
new bool:Nightvision[MAXPLAYERS + 1];
new bool:FroggyJump[MAXPLAYERS + 1];
new bool:started;
public Plugin:myinfo =
{
name = "Dice SM",
author = "Popoklopsi, edit shanapu",
version = "1.6.2-zstore edit",
description = "Roll the Dice by Popoklopsi",
url = "https://forums.alliedmods.net/showthread.php?t=152035"
};
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
{
MarkNativeAsOptional("GetUserMessageType");
return APLRes_Success;
}
public OnPluginStart()
{
if (!CColorAllowed(Color_Lightgreen) && CColorAllowed(Color_Darkred))
CReplaceColor(Color_Lightgreen, Color_Darkred);
started = false;
AutoExecConfig_SetFile("dice_config", "dice");
AutoExecConfig_CreateConVar("dice_sm", "1.6.2", "Dice for Souremod by Popoklopsi", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
c_DiceText = AutoExecConfig_CreateConVar("dice_text", "dice", "Command to dice (without exclamation mark), convert to UTF-8 without BOM for special characters");
c_ShowNumber = AutoExecConfig_CreateConVar("dice_show", "2", "Players, which see the result: 1 = Everybody, 2 = just T's, 3 = just CT's, 4 = Only you");
c_RandNumber = AutoExecConfig_CreateConVar("dice_rand", "1", "1 = Random text when result is a weapon, 0 = Off");
c_DiceTeam = AutoExecConfig_CreateConVar("dice_team", "2", "2 = Only T's can dice, 3 = Only CT's can dice, 0 = Everybody can dice");
c_DiceCount = AutoExecConfig_CreateConVar("dice_count", "1", "How often a player can dice per round");
c_DiceMoney = AutoExecConfig_CreateConVar("dice_money", "0", "x = Money one dice costs, 0 = Off");
if (!started)
{
Format(ConsoleCmd, sizeof(ConsoleCmd), "sm_%s", DiceText);
RegConsoleCmd(ConsoleCmd, TypedText);
started = true;
}
}
public OnAllPluginsLoaded()
{
if (LibraryExists("updater"))
Updater_AddPlugin("http://popoklopsi.de/dice/update.txt");
}
public OnLibraryAdded(const String:name[])
{
if (StrEqual(name, "updater"))
Updater_AddPlugin("http://popoklopsi.de/dice/update.txt");
}
public OnMapStart()
{
PrecacheSound("weapons/rpg/rocketfire1.wav");
PrecacheSound("weapons/rpg/rocket1.wav");
PrecacheSound("weapons/hegrenade/explode3.wav");
PrecacheModel("Effects/tp_eyefx/tp_eyefx.vmt");
}
public LoadEnables()
{
decl String:section[5];
new Handle:keycvar = CreateKeyValues("DiceEnables");
if (FileExists("cfg/dice/dice_enables.txt") && FileToKeyValues(keycvar, "cfg/dice/dice_enables.txt"))
{
for (new x = 1; x <= DICES; x++)
{
Format(section, sizeof(section), "%i", x);
if (KvGetNum(keycvar, section, 1) == 1)
EnabledNumbers[x] = true;
else
EnabledNumbers[x] = false;
}
}
else
{
for (new x = 1; x <= DICES; x++)
EnabledNumbers[x] = true;
}
if (!getGame())
EnabledNumbers[1] = false;
}
public Action:TypedText(client, args)
{
if (client > 0 && client <= MaxClients && IsClientInGame(client))
PrepareDice(client);
return Plugin_Handled;
}
public OnConVarChanged(Handle:hCvar, const String:oldValue[], const String:newValue[])
{
if (hCvar == c_ShowNumber)
ShowNumber = StringToInt(newValue);
if (hCvar == c_RandNumber)
RandNumber = StringToInt(newValue);
if (hCvar == c_DiceTeam)
DiceTeam = StringToInt(newValue);
}
public RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
new Handle:fr = FindConVar("sv_friction");
new Handle:ac = FindConVar("sv_accelerate");
public OnGameFrame()
{
for (new i = 1; i < MaxClients + 1; i++)
{
if (IsClientInGame(i) && IsPlayerAlive(i) && Nightvision[i])
SetEntProp(i, Prop_Send, "m_bNightVisionOn", 1);
}
}
public SetInvisible(client, bool:visible)
{
new weapon;
new Handle:c_DiceText; new Handle:c_ShowNumber; new Handle:c_RandNumber; new Handle:c_DiceTeam; new Handle:c_DiceCount; new Handle:c_DiceMoney;
new String:DiceText[64];
new ShowNumber; new RandNumber; new DiceTeam; new DiceMoney; new DiceCount;
new friction_default = -1; new accelerate_default = -1;
new NoclipCounter[MAXPLAYERS + 1]; new ClientDiced[MAXPLAYERS + 1]; new FroggyJumped[MAXPLAYERS + 1]; new fire[MAXPLAYERS + 1];
new bool:EnabledNumbers[DICES+1]; new bool:LongJump[MAXPLAYERS + 1]; new bool:Nightvision[MAXPLAYERS + 1]; new bool:FroggyJump[MAXPLAYERS + 1]; new bool:started;
public Plugin:myinfo = { name = "Dice SM", author = "Popoklopsi, edit shanapu", version = "1.6.2-zstore edit", description = "Roll the Dice by Popoklopsi", url = "https://forums.alliedmods.net/showthread.php?t=152035" };
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max) { MarkNativeAsOptional("GetUserMessageType");
return APLRes_Success; }
public OnPluginStart() { if (!CColorAllowed(Color_Lightgreen) && CColorAllowed(Color_Darkred)) CReplaceColor(Color_Lightgreen, Color_Darkred);
started = false;
AutoExecConfig_SetFile("dice_config", "dice"); AutoExecConfig_CreateConVar("dice_sm", "1.6.2", "Dice for Souremod by Popoklopsi", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
c_DiceText = AutoExecConfig_CreateConVar("dice_text", "dice", "Command to dice (without exclamation mark), convert to UTF-8 without BOM for special characters"); c_ShowNumber = AutoExecConfig_CreateConVar("dice_show", "2", "Players, which see the result: 1 = Everybody, 2 = just T's, 3 = just CT's, 4 = Only you"); c_RandNumber = AutoExecConfig_CreateConVar("dice_rand", "1", "1 = Random text when result is a weapon, 0 = Off"); c_DiceTeam = AutoExecConfig_CreateConVar("dice_team", "2", "2 = Only T's can dice, 3 = Only CT's can dice, 0 = Everybody can dice"); c_DiceCount = AutoExecConfig_CreateConVar("dice_count", "1", "How often a player can dice per round"); c_DiceMoney = AutoExecConfig_CreateConVar("dice_money", "0", "x = Money one dice costs, 0 = Off");
if (!started) { Format(ConsoleCmd, sizeof(ConsoleCmd), "sm_%s", DiceText); RegConsoleCmd(ConsoleCmd, TypedText);
started = true; } }
public OnAllPluginsLoaded() { if (LibraryExists("updater")) Updater_AddPlugin("http://popoklopsi.de/dice/update.txt"); }
public OnLibraryAdded(const String:name[]) { if (StrEqual(name, "updater")) Updater_AddPlugin("http://popoklopsi.de/dice/update.txt"); }
public OnMapStart() { PrecacheSound("weapons/rpg/rocketfire1.wav"); PrecacheSound("weapons/rpg/rocket1.wav"); PrecacheSound("weapons/hegrenade/explode3.wav"); PrecacheModel("Effects/tp_eyefx/tp_eyefx.vmt"); }
public LoadEnables() { decl String:section[5];
new Handle:keycvar = CreateKeyValues("DiceEnables");
if (FileExists("cfg/dice/dice_enables.txt") && FileToKeyValues(keycvar, "cfg/dice/dice_enables.txt")) { for (new x = 1; x <= DICES; x++) { Format(section, sizeof(section), "%i", x);
if (KvGetNum(keycvar, section, 1) == 1) EnabledNumbers[x] = true; else EnabledNumbers[x] = false; } } else { for (new x = 1; x <= DICES; x++) EnabledNumbers[x] = true; }
if (!getGame()) EnabledNumbers[1] = false; }
public Action:TypedText(client, args) { if (client > 0 && client <= MaxClients && IsClientInGame(client)) PrepareDice(client);
return Plugin_Handled; }
public OnConVarChanged(Handle:hCvar, const String:oldValue[], const String:newValue[]) { if (hCvar == c_ShowNumber) ShowNumber = StringToInt(newValue);
if (hCvar == c_RandNumber) RandNumber = StringToInt(newValue);
if (hCvar == c_DiceTeam) DiceTeam = StringToInt(newValue); }
public RoundStart(Handle:event, const String:name[], bool:dontBroadcast) { new Handle:fr = FindConVar("sv_friction"); new Handle:ac = FindConVar("sv_accelerate");
public OnGameFrame() { for (new i = 1; i < MaxClients + 1; i++) { if (IsClientInGame(i) && IsPlayerAlive(i) && Nightvision[i]) SetEntProp(i, Prop_Send, "m_bNightVisionOn", 1); } }
public SetInvisible(client, bool:visible) { new weapon;