Why my gun not load[Mysql]
#1

see
PHP код:
public OnPlayerSpawn(playerid)
{
        new 
fieldsrowsstring[128];
        
cache_get_data(rowsfieldsgSQLHandle);
    
GivePlayerWeapon(playeridcache_get_field_content_int(0"Gunonhand"gSQLHandle), cache_get_field_content_int(0"Ammoonhand"gSQLHandle));
    
format(querysizeof(query), "UPDATE `user_accounts` SET `Gunonhand`=0,\
    `Ammoonhand`=0 WHERE `UserID` = %i"
PlayerInfo[playerid][pUserID]);
    
mysql_function_query(gSQLHandlequeryfalse"SaveUserAccount""ii"playerid3); 
The valve is already store in the database as i' had checked but here it seem a problem

Where am i wrong
Reply
#2

You should try placing the info from the database into temporary vars when the player connects and then give the player the weapon info from the vars instead of calling on MySQL every time they spawn.
Reply
#3

Quote:
Originally Posted by Infamous
Посмотреть сообщение
You should try placing the info from the database into temporary vars when the player connects and then give the player the weapon info from the vars instead of calling on MySQL every time they spawn.
That's not a big deal. This forum runs MySQL. Every time a user requests a page it sends about 15 queries. There are over 700 active users right now. You do the math.
Reply
#4

This forums database is good enough, probably not his. I'd say, Mysql is good, but sometimes you have to use files includes. Weapons Data could be in files, use Y_ini or whatever you feel comfortable using. If your database isn't really good to hold many connections at a time, OnPlayerSpawn queries isn't great.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)