new xp = str_to_num(arg2)
new cmd[32], arg[32]
new bool:giveXP = false
read_argv(0, cmd, charsmax(cmd))
read_argv(1, arg, charsmax(arg))
if ( equali(cmd, "amx_shaddxp") ) giveXP = true
new name2[32], authid2[32]
get_user_name(id, name2, charsmax(name2))
get_user_authid(id, authid2, charsmax(authid2))
if ( arg[0] == '@' ) {
new players[32], inum
if ( equali("T", arg[1]) ) {
copy(arg[1], charsmax(arg)-1, "TERRORIST")
}
if ( equali("ALL", arg[1]) ) {
get_players(players, inum)
}
else {
get_players(players, inum, "eg", arg[1])
}
if ( !inum ) {
console_print(id, "No clients in such team")
return PLUGIN_HANDLED
}
new user
for ( new a = 0; a < inum; a++ ) {
user = players[a]
if ( giveXP ) localAddXP(user, xp)
else gPlayerXP[user] = xp
displayPowers(user, false)
}
show_activity(id, name2, "%s %d XP graczowi %s", giveXP ? "dodal" : "set", xp, arg[1])
console_print(id, "[SH] %s %d XP on %s players", giveXP ? "Added" : "Set", xp, arg[1])
log_amx("[SH] ^"%s<%d><%s><>^" %s %d XP graczowi %s", name2, get_user_userid(id), authid2, giveXP ? "added" : "set", xp, arg[1])
}
else {
new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF)
if ( !player ) return PLUGIN_HANDLED
if ( giveXP ) localAddXP(player, xp)
else gPlayerXP[player] = xp
displayPowers(player, false)
new name[32], authid[32]
get_user_name(player, name, charsmax(name))
get_user_authid(player, authid, charsmax(authid))
show_activity(id, name2, "%s %d XP graczowi %s", giveXP ? "dodal" : "set", xp, name)
console_print(id, "[SH] Client ^"%s^" has been %s %d XP", name, giveXP ? "given" : "set to", xp)
log_amx("[SH] ^"%s<%d><%s><>^" %s %d XP on ^"%s<%d><%s><>^"", name2, get_user_userid(id), authid2, giveXP ? "added" : "set", xp, name, get_user_userid(player), authid)
}
return PLUGIN_HANDLED
}
Konkretnie chodzi mi o tą linię:
show_activity(id, name2, "%s %d XP graczowi %s", giveXP ? "dodal" : "set", xp, arg[1])Chciałbym usunąć z niej pierwszą część, tj. "id", gdyż po prostu paskudnie to wygląda, gdy w chacie wyświetla się wiadomość typu "GRACZ nazwa serwera dodał graczowi xxxx XP"
Niestety, samo skasowanie powoduje błąd przy kompilacji "argument type mismatch <argument 1>"
Proszę więc o pomoc, najlepiej w postaci wyjaśnienia, jak sobie z takim problemem poradzić.
Użytkownik *Szyjanq* edytował ten post 11.06.2012 14:22