[SQLITE] Spawns player at the center of the map.
#1

I want when a player spawns it sets his/her position from database fields: X, Y, Z, but instead it goes into the center of the map. Here is what I tried.

PHP код:
public OnPlayerSpawn(playerid)
{
    new
        
Query[250],
        
DBResultResult,
        
pName[250],
        
Field[20],
        
Floatx,
        
Floaty,
        
Floatz
    
;
    
GetPlayerName(playeridpNamesizeof(pName));
    
    
format(Querysizeof(Query), "SELECT * FROM `Accounts` WHERE Name = '%s'"pName);
    
Result db_query(DatabaseQuery);
    
    
db_get_field_assoc(Result"X"Field30);
    
db_get_field_assoc(Result"Y"Field30);
    
db_get_field_assoc(Result"Z"Field30);
    
    
SetPlayerPos(playeridxyz);
    
db_free_result(Result);
     return 
1;    

Can you help me please?
Reply


Messages In This Thread
[SQLITE] Spawns player at the center of the map. - by ChristolisTV - 26.09.2016, 12:31
Re: [SQLITE] Spawns player at the center of the map. - by TheDarkBlade - 26.09.2016, 12:46
Re: [SQLITE] Spawns player at the center of the map. - by ChristolisTV - 26.09.2016, 12:50
Re: [SQLITE] Spawns player at the center of the map. - by Konstantinos - 26.09.2016, 13:15

Forum Jump:


Users browsing this thread: 1 Guest(s)