Raised This Month: $ Target: $400
 0% 

Passing a string in function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 03-10-2017 , 18:36   Re: Passing a string in function
Reply With Quote #1

Quote:
Originally Posted by HamletEagle View Post
Pass the string size as a param.
Did you mean this:
PHP Code:
new team[32];
get_opposite_team(idattackerteamcharsmax(team));

stock get_opposite_team(indexteam[], len)
{
    new 
CsTeams:team cs_get_user_team(index);
    
    if(
team == CS_TEAM_T)
    {
        
copy(teamlen"TERRORIST"); // line 549;
    
}
    else
    {
        
copy(teamlen"CT"); // line 553;
    
}
    
    return 
0;
// line 557; 
If yes, still throws the same errors!

Quote:
Originally Posted by edon1337 View Post
?
Code:
if(equal(get_opposite_team(idattacker), "CT")) // ... // stock get_opposite_team(index) {     new CsTeams:team_player = cs_get_user_team(index);     new team[32];           if(team_player == CS_TEAM_T)     {         copy(team, charsmax(team), "TERRORIST"); // line 549;     }         else if(team_player == CS_TEAM_CT)     {         copy(team, charsmax(team), "CT"); // line 553;     }           return team; }
If I wanted to do it like that, I would, but this doesn't help me!

Last edited by KiLLeR.; 03-10-2017 at 18:41.
KiLLeR. is offline
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 18:02.


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