mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-26 13:51:01 +00:00
Server: Restore give command
sorta broken but whatever :^)
This commit is contained in:
parent
d4fafff812
commit
7702f79b35
1 changed files with 48 additions and 2 deletions
|
@ -28,12 +28,57 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Needed to iterate through all of the command table.
|
// Needed to iterate through all of the command table.
|
||||||
#define NUMBER_OF_COMMANDS 1
|
#define NUMBER_OF_COMMANDS 2
|
||||||
|
|
||||||
// Success/Failure return codes
|
// Success/Failure return codes
|
||||||
#define COMMAND_SUCCESS 0
|
#define COMMAND_SUCCESS 0
|
||||||
#define COMMAND_FAILURE 1
|
#define COMMAND_FAILURE 1
|
||||||
|
|
||||||
|
//
|
||||||
|
// Command_give(params)
|
||||||
|
// Usage: give <weapon_number>
|
||||||
|
//
|
||||||
|
float(string params) Command_give =
|
||||||
|
{
|
||||||
|
float wep = stof(argv(1));
|
||||||
|
|
||||||
|
if (wep) {
|
||||||
|
if (!self.secondaryweapon) {
|
||||||
|
WeaponSwitch(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
float startframe, endframe;
|
||||||
|
string modelname;
|
||||||
|
|
||||||
|
self.weapon = wep;
|
||||||
|
self.currentammo = getWeaponAmmo(wep);
|
||||||
|
self.currentmag = getWeaponMag(wep);
|
||||||
|
if (IsDualWeapon(wep)) {
|
||||||
|
self.currentmag2 = self.currentmag;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.weaponskin = GetWepSkin(self.weapon);
|
||||||
|
|
||||||
|
startframe = GetFrame(self.weapon,TAKE_OUT_START);
|
||||||
|
endframe = GetFrame(self.weapon,TAKE_OUT_END);
|
||||||
|
modelname = GetWeaponModel(wep, 0);
|
||||||
|
|
||||||
|
SwitchWeapon(wep);
|
||||||
|
|
||||||
|
Set_W_Frame (startframe, endframe, 0, 0, 0, SUB_Null, modelname, false, S_BOTH);
|
||||||
|
|
||||||
|
self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = 0;
|
||||||
|
|
||||||
|
#ifndef PC
|
||||||
|
self.Weapon_Name = GetWeaponName(self.weapon);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return COMMAND_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return COMMAND_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Command_addmoney(params)
|
// Command_addmoney(params)
|
||||||
// Usage: addmoney <point_value>
|
// Usage: addmoney <point_value>
|
||||||
|
@ -73,7 +118,8 @@ var struct {
|
||||||
float requires_arguments;
|
float requires_arguments;
|
||||||
string command_description;
|
string command_description;
|
||||||
} server_commands[] = {
|
} server_commands[] = {
|
||||||
{"addmoney", Command_addmoney, true, "Usage: addmoney <point_value>\n Gives `point_value` amount of points to the client who requested it.\n"}
|
{"addmoney", Command_addmoney, true, "Usage: addmoney <point_value>\n Gives `point_value` amount of points to the client who requested it.\n"},
|
||||||
|
{"give", Command_give, true, "Usage: give <weapon number>\n Gives `weapon` of index.\n"}
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue