Raised This Month: $ Target: $400
 0% 

string help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 05-15-2005 , 13:16   string help
Reply With Quote #1

i want to change
Code:
g_Answer = "banid 30.0 %s kick"

to banid <arg2> %s kick

how can i change the string?

EDIT:
Waht does this return if there isnt any arg?
Code:
new arg2[32] read_argv(2,arg2,31)
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-15-2005 , 14:02  
Reply With Quote #2

[EDIT]

1)
Code:
new banmsg[64] format(banmsg,63,"ban %d %s kick",arg1,arg2) server_cmd(banmsg)
I assume that's what you want.

2) It returns false or 0.

IE:
Code:
if(!arg2) {     // blah blah .. } if(arg2==0) {     // blah blah .. }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 05-15-2005 , 14:16  
Reply With Quote #3

not really, I still want the %s to be there...
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-15-2005 , 14:21  
Reply With Quote #4

IE: banid 0.0 STEAM_0:0611880
That's a number, so you want %d there.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 05-15-2005 , 14:46  
Reply With Quote #5

Code:
/* Vote Ban */ public cmdVoteBan(id,level,cid) {   if (!cmd_access(id,level,cid,2))     return PLUGIN_HANDLED   new Float:voting = get_cvar_float("amx_last_voting")   if (voting > get_gametime()) {     console_print(id, "%L", id, "ALREADY_VOTING")     return PLUGIN_HANDLED   }   if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) {     console_print(id, "%L", id, "VOTING_NOT_ALLOW")     return PLUGIN_HANDLED   }   new cmd[32]   read_argv(0,cmd,31)   new voteban = equal(cmd,"amx_voteban")   new arg[32]   read_argv(1,arg,31)   new player = cmd_target(id,arg,1)   if (!player) return PLUGIN_HANDLED   if (voteban && is_user_bot(player)) {     new imname[32]     get_user_name(player,imname,31)     console_print(id,"%L",id,"ACTION_PERFORMED",imname)     return PLUGIN_HANDLED   }   new arg2[32]   read_argv(2,arg2,31)   new keys = MENU_KEY_1|MENU_KEY_2   new menu_msg[256],lYes[16],lNo[16],lKickBan[16]   format(lYes,15,"%L",LANG_SERVER,"YES")   format(lNo,15,"%L",LANG_SERVER,"NO")   format(lKickBan,15,"%L",LANG_SERVER,"BAN")   ucfirst(lKickBan)   get_user_name(player,arg,31)   format(menu_msg,255,g_coloredMenus ?     "\y%s %s?\w^n^n1.  %s^n2.  %s" :     "%s %s?^n^n1.  %s^n2.  %s",     lKickBan, arg, lYes, lNo)   g_yesNoVote = 1   get_user_authid(player,g_optionName[0],31)   new authid[32],name[32]   get_user_authid(id,authid,31)   get_user_name(id,name,31)   log_amx("Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")",     name,get_user_userid(id),authid,"ban",arg)   new activity = get_cvar_num("amx_show_activity")   if (activity>0) {     new players[32],pnum,lTag[16]     get_players(players,pnum,"c")     for (new i=0;i<pnum;i++) {       format(lTag,15,"%L",players[i],is_user_admin(id)?"ADMIN":"USER")       format(lKickBan,15,"%L",players[i],"BAN")       switch (activity) {         case 2: client_print(players[i],print_chat,"%L",           players[i],"ADMIN_VOTE_FOR_2",lTag,name,lKickBan,arg)         case 1: client_print(players[i],print_chat,"%L",           players[i],"ADMIN_VOTE_FOR_1",lTag,lKickBan,arg)       }     }   }   g_execResult = true   new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0   set_cvar_float("amx_last_voting",  get_gametime() + vote_time )   g_voteRatio = get_cvar_float("amx_voteban_ratio")   g_Answer = arg2? "banid " : "banid 30.0 %s kick"   show_menu(0,keys,menu_msg,floatround(vote_time),"Ban ")   set_task(vote_time,"checkVotes" , 99889988 )   g_voteCaller = id   console_print(id, "%L", id, "VOTING_STARTED")   g_voteCount = {0,0,0,0}   return PLUGIN_HANDLED }
and this
Code:
 g_Answer = arg2? "banid %d %s kick" : "banid 30.0 %s kick"

but i want %d to be arg2

so the output is ie: "banid 0.0 s% kick"

but I dont even knew if this script will work. Im trying to modyfy the adminvote.sma so you can vote tempban....
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
Reply


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 16:45.


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