Raised This Month: $ Target: $400
 0% 

Looping Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 06-26-2010 , 17:18   Looping Help
Reply With Quote #1

Heres my code when i attempted to loop a players name from one funtion to another

PHP Code:
public cmdGames(id)
{
    new 
iMenu menu_create("\yLastRequest:^n\rby Nibbles/Shuttle_Wave""Games_Handler")

    
menu_additem(iMenu"\wBig Games""1"0);
    
menu_additem(iMenu"\wSmall""2"0);
    
    
menu_setprop(iMenuMPROP_EXITMEXIT_ALL);
    
menu_display(idiMenu0);
    
    new 
szName[32];
    
get_user_name(idszName31);
    
    
ChoosingG true;
    
    
TaskLoopNameChoosing(szName[id])
    
}    

public 
TaskLoopNameChoosing(szName)
{
    if(
ChoosingG)
    {
        
client_printc(0"%s !g%s!n Is Choosing a !gGame!n"PREFIXszName);
        
        
set_hudmessage(
            .
red 0,
            .
green 100,
            .
blue 255,
            .
= -1.0,
            .
0.45,
            .
holdtime 1.0,
            .
effects 1,
            .
channel = -1
            
);
            
        
show_hudmessage(0"%s Is Choosing a Game"szName);
        
        
set_task(1.0"TaskLoopNameChoosing"szName);
    }

Wat am i doing rong?


Cheers
Shuttle_Wave
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 06-26-2010 , 17:19   Re: Looping Help
Reply With Quote #2

NVM. I Found my problems. Thanks
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 06-26-2010 , 18:33   Re: Looping Help
Reply With Quote #3

Don't make 2 topics about the same.
__________________
I am out of order!
grimvh2 is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 06-26-2010 , 18:47   Re: Looping Help
Reply With Quote #4

OK. I tryed the plugin out and i got something every weird. It first shows on hud s{Shuttle_Wave} is choosing a Game when its suppose to say {Shuttle_Wave} is choosing a Game but i dont no how the s got into there. AFter 1 second it shows s is choosing game. wats the problem?>
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-26-2010 , 19:18   Re: Looping Help
Reply With Quote #5

Problem is your skill

szName in the public function you directly call is taken as a string, but in the public callback it's an integer.
You are even lucky that it works almost fine the 1st time.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 06-27-2010 , 01:05   Re: Looping Help
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Problem is your skill

szName in the public function you directly call is taken as a string, but in the public callback it's an integer.
You are even lucky that it works almost fine the 1st time.
Oh. Wat do i have to do to fix it?
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-27-2010 , 01:13   Re: Looping Help
Reply With Quote #7

PHP Code:
set_task(1.0"TaskLoopNameChoosing"szName); 
szName?

You are trying to pass an string value to the task, you can't do this... you have to pass in integer (id of the player for example)... so you should change this:

PHP Code:
TaskLoopNameChoosing(szName[id]) 
To this:

PHP Code:
set_task(1.0"TaskLoopNameChoosing"id); 
And get the name inside of the task... or maybe using the other parameters in the set_task( ) but i don't know about this, i never used that.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 06-27-2010 , 02:14   Re: Looping Help
Reply With Quote #8

Ok so far i did this but now the name doesnt show

PHP Code:
public cmdGames(id)
{
    new 
iMenu menu_create("\yLastRequest:^n\rby Nibbles/Shuttle_Wave""Games_Handler")

    
menu_additem(iMenu"\wBig Games""1"0);
    
menu_additem(iMenu"\wSmall""2"0);
    
    
menu_setprop(iMenuMPROP_EXITMEXIT_ALL);
    
menu_display(idiMenu0);
    
    new 
szName[32];
    
get_user_name(idszName31);
    
    
ChoosingG true;
    
    
set_task(1.0"TaskLoopNameChoosing"id);
    
}    

public 
TaskLoopNameChoosing(szName)
{
    if(
ChoosingG)
    {
        
client_printc(0"%s !g%s!n Is Choosing a !gGame!n"PREFIXszName);
        
        
set_hudmessage(
            .
red 0,
            .
green 100,
            .
blue 255,
            .
= -1.0,
            .
0.45,
            .
holdtime 1.0,
            .
effects 1,
            .
channel = -1
            
);
            
        
show_hudmessage(0"%s Is Choosing a Game"szName);
        
        
set_task(1.0"TaskLoopNameChoosing"id);
    }

__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-27-2010 , 02:22   Re: Looping Help
Reply With Quote #9

>.<

Code:
public cmdGames(id) {     new iMenu = menu_create("\yLastRequest:^n\rby Nibbles/Shuttle_Wave", "Games_Handler")     menu_additem(iMenu, "\wBig Games", "1", 0);     menu_additem(iMenu, "\wSmall", "2", 0);         menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL);     menu_display(id, iMenu, 0);         new szName[32];     get_user_name(id, szName, 31);         ChoosingG = true;         set_task( 1.0, "TaskLoopNameChoosing", id, _, _, "b" );     }     public TaskLoopNameChoosing(id) {     if(ChoosingG)     {         new szName[32]         get_user_name( id, szName, 31 )         client_printc(0, "%s !g%s!n Is Choosing a !gGame!n", PREFIX, szName);                 set_hudmessage(             .red = 0,             .green = 100,             .blue = 255,             .x = -1.0,             .y = 0.45,             .holdtime = 1.0,             .effects = 1,             .channel = -1             );                     show_hudmessage(0, "%s Is Choosing a Game", szName);     } }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-27-2010 , 06:11   Re: Looping Help
Reply With Quote #10

And remove the first:

Code:
    new szName[32];     get_user_name(id, szName, 31);
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Reply



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


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