Raised This Month: $ Target: $400
 0% 

Error Info


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 05-17-2012 , 08:05   Error Info
Reply With Quote #1

Code:
new string[100];
new name[get_user_name(playerid, sizeof(name), strlen(string)];
I am trying to get name of user,But few errors are happening.
Solve the below errors please.


ERRORS:
Error1: Undefined symbol "name" on line 20 //Which name is it talking about,There are two names?
Error2: Invalid expression, assumed zero on line 20 //What to do with this?
Error3: Expected token: ";", but found "]" on line 20 //What is this?

Last edited by Waleed; 05-17-2012 at 08:06.
Waleed is offline
Send a message via Skype™ to Waleed
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 05-17-2012 , 08:25   Re: Error Info
Reply With Quote #2

new name = get_user_name(playerid, sizeof(name), strlen(string);
__________________
kiki33hun is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-17-2012 , 08:31   Re: Error Info
Reply With Quote #3

You can't use natives like that. This is correct:



PHP Code:
new name[32]
get_user_name(playeridnamecharsmax(name)) 

You need to assign a variable and select where to store the name with given maximum characters.
Charsmax gets the maximum lenght that a string array can contain, it's the same as sizeof(name) - 1 (in this case, that's the same as 31).


Then the player name is stored into the "name" string.
__________________

Last edited by <VeCo>; 05-17-2012 at 08:31.
<VeCo> is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-18-2012 , 13:57   Re: Error Info
Reply With Quote #4

I didn't want to start a new thread for this question for its so short. This line gives me a "warning" on compile and i'm wondering why....

PHP Code:
#define LVL5 180        // Regular knife  RandomFloat(15, 75
#define LEVEL_INCREMENT 31    // Frags per level (after the defined levels 0-5)
new i_offset LVL5 - (LEVEL_INCREMENT*5
Quote:
Warning: Tag mismatch on line 857
Also....is my math right? for use in....
Code:
new Float:calc =  (g_playerFrags[id] + i_offset) / LEVEL_INCREMENT
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 05-18-2012 at 14:00. Reason: FUCK YOU THAT'S WHY!
Liverwiz is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-18-2012 , 13:59   Re: Error Info
Reply With Quote #5

That has nothing to do with this thread. Post a new one and show what LVL5 and LEVEL_INCREMENT are.
__________________

Last edited by <VeCo>; 05-18-2012 at 14:00.
<VeCo> is offline
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 00:20.


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