Witam, otóz mam problem z tym pluginem. Wszystko fajnie działa /przelej Nick 2000 to przelewa 2000kasy do innego gracza. Ale gdy wpisuje /przelej -2000 Nick to mu kradne kase. Nie wiem jak to przerobic zeby bylo to zablokowane. proszę o pomoc.
#include <amxmod>
#include <amxmisc>
#include <fun>
#include <colorchat>
public plugin_init() {
register_plugin("przelej","1.0","sprite")
register_concmd("say","handle_say",ADMIN_USER)
register_concmd("say_team","handle_say",ADMIN_USER)
register_cvar("mt_cashsteal","1",0)
register_cvar("mt_cashdead","1",0)
register_cvar("mt_cashteam","1",0)
return PLUGIN_CONTINUE
}
public handle_say(id) {
//Show me the money
new said[31]
new cmd[10]
new target[9]
new amount[7]
new rest[5]
read_args(said, 30)
replace(said, 30, "^"", "")
parse(said, cmd,9, target,8, amount,6, rest,4)
new player = cmd_target(id,target,8)
new name[33]
new name2[33]
get_user_name(id,name,32)
get_user_name(player,name2,32)
new team[32]
new team2[32]
get_user_team(id,team,32)
get_user_team(player,team2,32)
if (equal(cmd, "/przelej", 9)) {
new money = get_user_money(id)
new money2 = get_user_money(player)
new cash = str_to_num(amount)
new bool:NoCantDo
NoCantDo=false
if (!is_user_alive(id)) {
if (get_cvar_num("mt_cashdead")==0) {
client_print(id,print_center,"Nie mozesz dac pieniedzy, poniewaz jestes martwy")
NoCantDo=true
}
}
if (!is_user_alive(player)) {
if (get_cvar_num("mt_cashdead")==0) {
client_print(id,print_center,"Nie mozesz dac pieniedzy martwemu graczowi")
NoCantDo=true
}
}
if (equal(name, name2)) {
client_print(id,print_center,"Nie mozesz dac sobie pieniedzy")
NoCantDo=true
}
if (!equal(team, team2)) {
if (get_cvar_num("mt_cashteam")==0) {
client_print(id,print_center,"Nie mozesz dac pieniedzy przeciwnej druzynie")
NoCantDo=true
}
}
if ((money2 + cash) > 18000) {
client_print(id,print_center,"%s nie moze miec wiecej pieniedzy")
NoCantDo=true
}
if (money < cash) {
client_print(id,print_center,"Nie masz tyle kasy")
NoCantDo=true
}
if (cash < 0) {
if (get_cvar_num("mt_cashsteal")==1) {
client_print(id,print_center,"Nie mozesz zabrac pieniedzy garczowi %s",name2)
NoCantDo=true
}
}
if (!NoCantDo) {
set_user_money(id, money - cash,1)
set_user_money(player, money2 + cash,1)
ColorChat(0,GREEN,"^x04%s ^x01przelal ^x03%i $ do ^x04%s",name,cash,name2);
}
}
return PLUGIN_CONTINUE
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/


Dodatki SourceMod













