Quote:
Originally Posted by Rohanlogs
plz no hate
|
You will probably never receive hate, unless you're asking for trouble. What you are going to get is criticism, so you can improve your coding and make better plugins.
I'll start with something easy. Please indent your plugin properly. I took the liberty to do it for you so you can get an idea of how it can be done.
dank_plagen.sma
>>
PHP Code:
/* Plagen :D */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Denk Ferst Plagen xD"
#define VERSION "1.0"
#define AUTHOR "taski"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_denk", "cmd_hp", ADMIN_SLAY, "<nick> <hp> ")
}
public cmd_hp(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new Arg1[24], Arg2[4]
read_argv(1, Arg1, 23)
read_argv(2, Arg2, 3)
new Health = str_to_num(Arg2)
if (Arg1[0] == '@')
{
new Team = 0
if (equali(Arg1[1], "CT"))
Team = 2
else if (equali(Arg1[1], "T"))
Team = 1
new players[32], num
get_players(players, num)
new i
for (i=0; i<num; i++)
{
if (!Team)
set_user_health(players[1], Health)
else
{
if (get_user_team(players[i]) == Team)
set_user_health(players[i], Health)
}
}
}
else
{
new player = cmd_target(id, Arg1, 0)
if (!player)
{
console_print(id, "Soz fagit, player %s isn't even here dumbass, fagit!", Arg1)
return PLUGIN_HANDLED
}
else
set_user_health(player, Health)
}
return PLUGIN_HANDLED
}
This won't guarantee an approval, but make the plugin less painful to read, asides is always good to read a properly indented plugin.
https://forums.alliedmods.net/forumdisplay.php?f=11
https://forums.alliedmods.net/forumdisplay.php?f=83
These forums are good places to learn. If you have any question you can always ask in the Scripting Help sub-forum.
Cheers
__________________