Raised This Month: $68 Target: $400
 17% 

Subplugin Submission AmmoPacks per map (like Lgk)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Noam
Member
Join Date: Jun 2019
Old 09-12-2019 , 13:43   AmmoPacks per map (like Lgk)
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <ColorChat>
new Trie:used_command

public plugin_init()
{
register_plugin("AmmoPacks Per Map""1.1""Hades ~~~`");

register_clcmd("say /rtd""ApCommand");
register_clcmd("say rtd""ApCommand");
register_clcmd("say /free""ApCommand");
register_clcmd("say /get""ApCommand");
used_command TrieCreate()
}
public 
ApCommand(id)
{
new 
szAuthid[35]
get_user_authid(id szAuthid charsmax(szAuthid)) // szAuthid now contains user authid
if( TrieKeyExistsused_commandszAuthid ) )  // if we have szAuthid in trie 
{
ColorChat(id,NORMAL"You already^3 used^1 this command^4 Try^3 NextMap^1.");
}
else
{
new 
Random random_num(1,4)
switch(
Random)
{
case 
0:
{
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + 20);
ColorChat(id,NORMAL"You have got^3 20^1 ammopacks for^3 using^1 a legit client.");
}
case 
1:
{
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + 30);
ColorChat(id,NORMAL"You have got^3 30^1 ammopacks for^3 using^1 a legit client.");
}
case 
2:
{
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + 40);
ColorChat(id,NORMAL"You have got^3 40^1 ammopacks for^3 using^1 a legit client.");
}
case 
3:
{
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + 50);
ColorChat(id,NORMAL"You have got^3 50^1 ammopacks for^3 using^1 a legit client.");
}
}
}
TrieSetCellused_commandszAuthid)  // save user authid in tire
}
public 
plugin_end( )
{
    
TrieDestroyused_command )

rtd,free,get system random ammopacks between 20-50. you can edit.
Thanks to @LearninG for saving each player using command.

Last edited by Noam; 09-13-2019 at 14:27. Reason: Update
Noam is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:59.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode