What is wrong with the command:
DrawText(GetAttribute("points","Player",48,48,255,10,255,255,255);
All that happens when i do it is that the pawn can't move and the console just says " :11: Parse error near "
I have declared points in player.ini and I can't see what could be wrong.
Thanks
Draw Text Parse Error
Re: Draw Text Parse Error
Should there be another bracket the end?wabogenadod wrote:What is wrong with the command:
DrawText(GetAttribute("points","Player",48,48,255,10,255,255,255);
All that happens when i do it is that the pawn can't move and the console just says " :11: Parse error near "
I have declared points in player.ini and I can't see what could be wrong.
Thanks
DrawText(GetAttribute("points","Player",48,48,255,10,255,255,255));
Steve Dilworth - Resisting change since 1965!
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Draw Text Parse Error
That should be:
Code: Select all
DrawText(toString(GetAttribute("points","Player")), 48,48, 255, 10, 255,255,255);
-
- Posts: 18
- Joined: Mon Dec 17, 2012 9:59 pm
Re: Draw Text Parse Error
Why "toString()"QuestOfDreams wrote:That should be:Code: Select all
DrawText(toString(GetAttribute("points","Player")), 48,48, 255, 10, 255,255,255);
What does that do?
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Draw Text Parse Error
toString is a Simkin method, which converts any type of variable to a string.
Why use it? Because the DrawText method expects the first argument to be a string while the GetAttribute method returns an integer value.
The current version of RF also accepts the integer value and converts it internally, but future versions may do a more rigid type checking of parameters, thus it's a cleaner style of scripting.
Why use it? Because the DrawText method expects the first argument to be a string while the GetAttribute method returns an integer value.
The current version of RF also accepts the integer value and converts it internally, but future versions may do a more rigid type checking of parameters, thus it's a cleaner style of scripting.