Hello i want to give my self gun but i get an error and when i remove the gun code the error goes away
ERROR;
"not all code paths return a value"
Code for guns
My error is here ""
ERROR;
Code:
Error 13 'plugin_test.plugin_test.OnSay(string, Addon.ServerClient)': not all code paths return a value c:\users\steffen\documents\visual studio 2010\Projects\TestPlugin\TestPlugin\Class1.cs 21
Code for guns
Code:
public override ChatType OnSay(string Message, ServerClient Client)
{
ServerPrint("Player " + Client.Name + " said " + Message);
if (Message == "!getxuid")
{
TellClient(Client.ClientNum, "Your xuid is: \'" + Client.XUID + "\'.", true);
return ChatType.ChatNone;
}
if (Message == "!help")
{
TellClient(Client.ClientNum, "Commands: !getxuid, !help", true);
return ChatType.ChatNone;
}
if (Client.XUID == "you dont need this")
{
if (Message == "!admin")
{
iPrintLnBold("^6Reckless is OP", Client);
Client.OriginZ = 6000f;
int WepID = GetWeapon("iw5_acr_mp");
int SecwID = GetWeapon("iw5_deserteagle_mp");
Client.Other.PrimaryWeaponAkimbo = false; // TURN TRUE FOR AKIMBO ACR
Client.Ammo.PrimaryAkimboAmmo = 500;
Client.Ammo.SecondaryAkimboAmmo = 500;
Client.Ammo.PrimaryAmmo += 1000;
Client.Ammo.SecondaryAmmo += 1000;
Client.Other.PrimaryWeapon = WepID;
Client.Other.SecondaryWeapon = SecwID;
}
else if (Client.XUID == "you dont need this")
{
if (Message == "!admin")
{
iPrintLnBold("^6RedRum is OP", Client);
Client.OriginZ = 6000f;
int Wep2ID = GetWeapon("iw5_acr_mp_acog_silencer_heartbeat_grip");
int Secw2ID = GetWeapon("iw5_deserteagle_mp");
Client.Other.PrimaryWeaponAkimbo = true; //AKIMBO DEAGLES
Client.Ammo.PrimaryAkimboAmmo = 500;
Client.Ammo.SecondaryAkimboAmmo = 500;
Client.Ammo.PrimaryAmmo += 10000000; //primary ammo
Client.Ammo.SecondaryAmmo += 1000000; //secondary ammo
Client.Other.PrimaryWeapon = Wep2ID;
Client.Other.SecondaryWeapon = Secw2ID;
}
else
{
TellClient(Client.ClientNum, "No permission!", true);
}
return ChatType.ChatContinue;//Send the chat to the next plugin [Eventually to the game]
}
}
}
My error is here "
Code:
public override ChatType OnSay(string Message, ServerClient Client)