%s dont work pls help im a noob in scripting
Hello guys. Why doesnt this line work?
client_print(0, print_chat, "%s went to: Zombie Plague 1 [Day]. Say: /server to follow him.", get_player_name(id)); the line is in this public: public menu_handler(id, menu, item) {} can somebody help me pls |
Re: %s dont work pls help im a noob in scripting
new szName[33]
get_user_name(id, szName, 32) client_print(0, print_chat, "%s went to: Zombie Plague 1 [Day]. Say: /server to follow him.", szName); |
Re: %s dont work pls help im a noob in scripting
Quote:
|
Re: %s dont work pls help im a noob in scripting
Thanks, i try it now =)
First i show message then i redirect =) |
Re: %s dont work pls help im a noob in scripting
OK it worked but i dont understand why...
get_user_name saves the name into the varibale szName. but why 33 and 32 what are this nummbers standing for? // SRY for the double posting |
Re: %s dont work pls help im a noob in scripting
it can also be
szName[18] get_user_name(id, szName, 17) |
Re: %s dont work pls help im a noob in scripting
could it also be 2 and 1? :|
|
Re: %s dont work pls help im a noob in scripting
i don't know i never tested it
|
Re: %s dont work pls help im a noob in scripting
Pawn uses null terminated strings which means you must always create your variable 1 size larger than the max you will need. This is why, for example, you will see a variable created at size 32 but the size inputted to the function is 31. The extra cell is reserved for a null character which signifies the end of string. Google null terminated strings for further reading.
|
| All times are GMT -4. The time now is 05:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.