X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_weaponsystem.qc;h=3f8581a432df5685604aaf365af5cf449c9b25e0;hb=a3c1b020aadcb8cdd4a282b2604a45ad18ea1b4a;hp=15898759ede6b82578b755a365ecebcda5a1cc36;hpb=bf5661dfd2df8cbc04183e7f007b236d92333e4b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 15898759e..3f8581a43 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -907,6 +907,16 @@ void CL_SpawnWeaponentity() self.exteriorweaponentity.nextthink = time; }; +void Send_WeaponComplain (entity e, float wpn, string wpnname, float type) +{ + msg_entity = e; + WriteByte(MSG_ONE, SVC_TEMPENTITY); + WriteByte(MSG_ONE, TE_CSQC_WEAPONCOMPLAIN); + WriteByte(MSG_ONE, wpn); + WriteString(MSG_ONE, wpnname); + WriteByte(MSG_ONE, type); +} + .float hasweapon_complain_spam; float client_hasweapon(entity cl, float wpn, float andammo, float complain) @@ -949,6 +959,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) { play2(cl, "weapons/unavailable.wav"); sprint(cl, strcat("You don't have any ammo for the ^2", W_Name(wpn), "\n")); + Send_WeaponComplain (cl, wpn, W_Name(wpn), 0); } return FALSE; } @@ -962,6 +973,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) if(weaponsInMap & weaponbit) { sprint(cl, strcat("You do not have the ^2", W_Name(wpn), "\n") ); + Send_WeaponComplain (cl, wpn, W_Name(wpn), 1); if(cvar("g_showweaponspawns")) { @@ -989,7 +1001,10 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) } } else + { + Send_WeaponComplain (cl, wpn, W_Name(wpn), 2); sprint(cl, strcat("The ^2", W_Name(wpn), "^7 is ^1NOT AVAILABLE^7 in this map\n") ); + } play2(cl, "weapons/unavailable.wav"); }