Jump to content
GIGN Forum

Client Print Uz Coloorchat


Recommended Posts

Tātad, varat palīdzēt? _ Man vajadzētu šim pluginam pielikt krāsas, kā to izdarīt?

Esu mēģinājis ar colorchat includi, bet nekas nesanāk. /iedot plugins:

#include <amxmod>

#include <amxmisc>

#include <cstrike>

public plugin_init() {

register_plugin("Cash Transfer","1.0 Beta","Teflon.FT")

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)

if (equal(cmd, "/give", 9)) {

if(!contain(amount, "-")) {

client_print(id, print_chat, "Don't steel money, you will get a ban ;[")

return PLUGIN_HANDLED

}

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)

new money = cs_get_user_money(id)

new money2 = cs_get_user_money(player)

new cash = str_to_num(amount)

new bool:NoCantDo

NoCantDo=false

if(cash == 0) {

client_print(id,print_center," You have to give more then 0$$$!")

NoCantDo=true

}

if (!is_user_alive(id)) {

if (get_cvar_num("mt_cashdead")==0) {

client_print(id,print_center,"You can't give away money while dead")

NoCantDo=true

}

}

if (!is_user_alive(player)) {

if (get_cvar_num("mt_cashdead")==0) {

client_print(id,print_center,"You can't give money dead player!")

NoCantDo=true

}

}

if (equal(name, name2)) {

client_print(id,print_center,"You can't give money yourself!")

NoCantDo=true

}

if (!equal(team, team2)) {

if (get_cvar_num("mt_cashteam")==0) {

client_print(id,print_center,"You can't give money to enemy!")

NoCantDo=true

}

}

if ((money2 + cash) > 16000) {

client_print(id,print_center,"%s can't have that much money!")

NoCantDo=true

}

if (money < cash) {

client_print(id,print_center,"You don't have enough money!")

NoCantDo=true

}

if (cash < 0) {

if (get_cvar_num("mt_cashsteal")==0) {

client_print(id,print_center,"You can't steel money %s",name2)

NoCantDo=true

}

}

if (!NoCantDo) {

cs_set_user_money(id, money - cash,1)

cs_set_user_money(player, money2 + cash,1)

client_print(0,print_chat,"moXX Bank: Inform %s transfered to %i $ %s. Say Thanks! ;)",name,cash,name2)

}

}

return PLUGIN_CONTINUE

kā no client print pāriet uz colorchat, galvenais salikt visu kā vajag, krāsas salikšu pats.

paldies!

Link to comment
Share on other sites

https://forums.alliedmods.net/showthread.php?t=149555

Aizstāj:

client_print(id,print_center,"%s can't have that much money!")

uz

ColorChat(id, GREEN, "%s can't have that much money!"); 

vai arī uz

ColorChat(0, GREEN, "%s can't have that much money!"); 

Ar id ir tad, ja vajag noteiktam cilvēkam un 0, ja visiem spēlētājiem.

Pieliec klāt vēl include <colorchat>

Link to comment
Share on other sites

Visu izdaru, bet šī komanda floodojas

public otomesaj(id)
{
ColorChat(id, GREEN, "[****]^x03 ^x01Iegadajies VIP par samera letu cenu, - http://cs.****.lv")
}

piespamo visu čatu.. :(

Edited by pro
Link to comment
Share on other sites

Kods no 1. posta nesatur koda fragmentu no 3. posta.

Spriežot pēc teksta, tas kods varētu būt no VIP plugina.

Es vienkārši aizstāju vietu, kur ir /iedot -summa, lai izlec tieši šāds teksts. pašsaprotami

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...