Raised This Month: $ Target: $400
 0% 

[Resolved] read_argv and contain help plz!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-06-2006 , 21:51   [Resolved] read_argv and contain help plz!
Reply With Quote #1

Hi, I am trying to have it so you type "/goto <playername>" and you will go to that players origin. I want it so you don't have to type their full name in though, just some of it. Right now when I type "/goto <their name>" nothing happens. When I just type "/goto", it takes me to 0,0,0 i'm guessing and it shouldn't do anything when I type just /goto.

Here is my code so far...
Code:
public gotoPlayer(id) {     new nameArg[32];     read_argv(1, nameArg, 31);         new players[32];     new num;     get_players(players, num, "a");     for(new i = 1; i <= num; i++) {         new name[32];         get_user_name(i, name, 31)         if(contain(name, nameArg)) {             new nameid;             new origin[3];             nameid = get_user_index(name);             get_user_origin(nameid, origin, 0);             set_user_origin(id, origin);             client_print(id, print_chat, "[CSM] You have gone to %s's position.", name);         } else {             client_print(id, print_chat, "[CSM] Nobody has the name you entered.");         }     } }

Last edited by hlstriker; 12-07-2006 at 09:53. Reason: Resolved
hlstriker is offline
 



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 06:59.


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