Raised This Month: $344 Target: $400
 86%   Almost there!

Get variable value from function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Touch
Member
Join Date: Apr 2010
Location: Ukraine
Old 12-15-2010 , 08:02   Get variable value from function
Reply With Quote #1

Hello!
Please tell me how to get data from a variable in the function of player_spawn?

Need to variable rec2 work in player_spawn.


Function

PHP Code:
public OnSocketReceive(Handle:socketString:rec[], const dataSizeany:arg)
{
decl String:rec2[1024];
strcopy(receiveData2sizeof(rec2), rec[250]);

Player_spawn
PHP Code:
public Action:Player_Spawn(Handle:event, const String:name[], bool:dontBroadcast)

PrintToServer(rec2); // ERROR, rec2 

Thanks!
Touch is offline
Send a message via Skype™ to Touch
dordnung
Veteran Member
Join Date: Apr 2010
Old 12-15-2010 , 08:06   Re: Get variable value from function
Reply With Quote #2

PHP Code:
new String:rec2[1024];

public 
OnSocketReceive(Handle:socketString:rec[], const dataSizeany:arg)
{
    
Format(rec2sizeof(rec2), rec);
}  

public 
Action:Player_Spawn(Handle:eventconstString:name[], bool:dontBroadcast)

    
PrintToServer(rec2);

__________________
dordnung is offline
Touch
Member
Join Date: Apr 2010
Location: Ukraine
Old 12-15-2010 , 08:15   Re: Get variable value from function
Reply With Quote #3

Quote:
Originally Posted by Popoklopsi View Post
PHP Code:
new String:rec2[1024];

public 
OnSocketReceive(Handle:socketString:rec[], const dataSizeany:arg)
{
    
Format(rec2sizeof(rec2), rec);
}  

public 
Action:Player_Spawn(Handle:eventconstString:name[], bool:dontBroadcast)

    
PrintToServer(rec2);

Oh sorry...
Thanks! It works!

Last edited by Touch; 12-15-2010 at 08:19.
Touch is offline
Send a message via Skype™ to Touch
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 08:17.


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