SA-MP Forums Archive
mysql don't give the variable in game - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql don't give the variable in game (/showthread.php?tid=663773)



mysql don't give the variable in game - OuDayas - 10.02.2019

Hi, I've write a simple GM in mysql, with a symple registration and login system for RP server...
The problem is... when the player go to the server and finish the registration, the script set the player position in a default point, with a random skin for the selected gender, but... when the player exit from the server and try to enter again, the script didn't set the saved skin id, but set a random id called "741355568", how can i fix that? because if I change in game the skin and re-enter in the server I have the same problem.

This is the script where i have this problem


Re: mysql don't give the variable in game - Mugala - 10.02.2019

I think that problem is here.
PHP код:
                cache_get_value_int(0"skingiocatore"Player[playerid][SkinPlayer]);
                new 
skinid Player[playerid][SkinPlayer];
                
SetPlayerSkin(playeridskinid); 
I don't know what MySQL version u're using but in most cases, u must use cache_get_value_int like that way: skinid = cache_get_value_int(numrow,"sql");

so the right code must be like this.
PHP код:
                Player[playerid][SkinPlayer] = cache_get_value_int(0"skingiocatore");
                
SetPlayerSkin(playeridPlayer[playerid][SkinPlayer]); 
and also, make sure that you have a right skin saved in your SQL base.


Re: mysql don't give the variable in game - OuDayas - 10.02.2019

Mine is v41-4.
and if I try the method tha tu told me, i have this error:

error 017: undefined symbol "cache_get_value_int_ovrld"

Quote:
Originally Posted by Mugala
Посмотреть сообщение
I think that problem is here.
PHP код:
                cache_get_value_int(0"skingiocatore"Player[playerid][SkinPlayer]);
                new 
skinid Player[playerid][SkinPlayer];
                
SetPlayerSkin(playeridskinid); 
I don't know what MySQL version u're using but in most cases, u must use cache_get_value_int like that way: skinid = cache_get_value_int(numrow,"sql");

so the right code must be like this.
PHP код:
                Player[playerid][SkinPlayer] = cache_get_value_int(0"skingiocatore");
                
SetPlayerSkin(playeridPlayer[playerid][SkinPlayer]); 
and also, make sure that you have a right skin saved in your SQL base.



Re: mysql don't give the variable in game - Mugala - 10.02.2019

what is "cache_get_value_int_ovrld" ? it's not correct.


Re: mysql don't give the variable in game - OuDayas - 10.02.2019

I don't know, I didn't used that code, I used the code that u gived to me... maybe is literally a bugged script? because i take a MySQL base from MySQL developer... here link

Quote:
Originally Posted by Mugala
Посмотреть сообщение
what is "cache_get_value_int_ovrld" ? it's not correct.



Re: mysql don't give the variable in game - ComDuck - 11.02.2019

I'm looking at your UpdatePlayerData function, how are you sending the query? You commented out literally every SQL query code in there.


Re: mysql don't give the variable in game - OuDayas - 11.02.2019

Quote:
Originally Posted by ComDuck
Посмотреть сообщение
I'm looking at your UpdatePlayerData function, how are you sending the query? You commented out literally every SQL query code in there.
It's because i have tested more codes


Re: mysql don't give the variable in game - ComDuck - 11.02.2019

Quote:
Originally Posted by OuDayas
Посмотреть сообщение
It's because i have tested more codes
Which query code is the one that you are using in your production server?