17.05.2010, 15:16
Hello,
I built a menu and had a problem with it. At the menu-create (cmd /skin) the script checks the mysql-databbase for all skins in a special table. If the skinname is "frei" the for-loop breaks;
The idea for the menu is working, but I've got a problem with the OnPlayerSelectedMenuRow.
Here's the script:
NOW here's the problem: Every time I used this menu I got teleported to the point 0.0,0.0,0.0. So I printed (print(pSkin[0]) the X-Coordinate of the player (mysql = skin1x) and it printed in the console the text "sssname". I dunno why. So I'm asking here.
I hope you can help
Padarom
I built a menu and had a problem with it. At the menu-create (cmd /skin) the script checks the mysql-databbase for all skins in a special table. If the skinname is "frei" the for-loop breaks;
The idea for the menu is working, but I've got a problem with the OnPlayerSelectedMenuRow.
Here's the script:
Quote:
new pName[MPN], pSkin[4], Menu:current; current = GetPlayerMenu(playerid); if(current == PlayerMenu[playerid]) { format(query,sizeof query,"SELECT * FROM `skin` WHERE `name` = '%s'",pName); mysql_query(query); mysql_store_result(); mysql_fetch_field("skin1x",pSkin[0]); mysql_fetch_field("skin1y",pSkin[1]); mysql_fetch_field("skin1z",pSkin[2]); mysql_fetch_field("skin1a",pSkin[3]); SetPlayerPos(playerid,floatstr(pSkin[0]),floatstr(pSkin[1]),floatstr(pSkin[2])); SetPlayerFacingAngle(playerid,floatstr(pSkin[3])); /* There will be up to 4 options in the menu, and every option will load a specific field out of the mysql. But I though if the first one don't work, I should fix the problem before doing the other ones. */ } |
I hope you can help
Padarom