Raised This Month: $ Target: $400
 0% 

Pissing me off....TS Weapon Crap


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 08-22-2005 , 01:18  
Reply With Quote #7

Quote:
Originally Posted by XxAvalanchexX
Great, but I thought your problem was the "extra" variable -- have you tried displaying it with %d and seeing if the output is different?
I'm using %d for the output, it echo's it back right, but now it isn't inserting anything into the sql. It was inserting the other information in there before I added the gunid variable.....any suggestions?

Thank You, Man.

---
Update: Here's the current script I'm Using:

Code:
////////////////////////////////////////////// //-------------------------------------------- //-Weapon Remember---Remo Williams------------ //-------------------------------------------- //////////////////////////////////////////////// #include <amxmodx> #include <amxmisc> #include <dbi> #include <engine> #include <fun> #include <tsx> new Sql:dbc new Result:result // Start of plugin public plugin_init() {     register_plugin("Weapon Checker","1.0","Remo Williams")     register_concmd("amx_savegun","check_weapons",ADMIN_IMMUNITY," - Saves Guns in TS")     register_concmd("amx_savegun2","check_w",ADMIN_IMMUNITY," - Saves Guns in TS")     register_concmd("amx_returngun","return_weapons",ADMIN_IMMUNITY," - Returns Guns in TS")     register_cvar("weapon_save_host","localhost")     register_cvar("weapon_save_user","root")     register_cvar("weapon_save_pass","")     register_cvar("weapon_save_db","economy")     set_task(1.0,"start_sql")     set_task(10.0, "check_weapons", _, _, _, "b", 1) } //Create a connection (BY Harbu public start_sql() {     new host[32], username[32], password[32], dbname[32], error[32]     get_cvar_string("weapon_save_host",host,32)     get_cvar_string("weapon_save_user",username,32)     get_cvar_string("weapon_save_pass",password,32)     get_cvar_string("weapon_save_db",dbname,32)     dbc = dbi_connect(host,username,password,dbname,error,32)     if (dbc == SQL_FAILED)         {         server_print("[WeaponSave] Could Not Connect To SQL Database^n")     }     else         {         server_print("[WeaponSave] Connected To SQL, Have A Nice Day!^n")     } } public check_weapons(id) {     new ammo, clip, mode, extra, authid[32], name[32]     get_user_authid(id,authid,sizeof(authid))     get_user_name(id, name, 31)     new gunid = ts_getuserwpn(id, ammo, clip, mode, extra)     if(!is_user_connected(id)) {         return PLUGIN_HANDLED     }     if(clip >= 1) {         get_user_authid(id, authid, 31)         dbi_query(Sql:dbc,"INSERT INTO plr_weapons (SteamID, gunid, ammo, clip, mode, extra) VALUES('%s','%d','%i','%i','%i','%d')", authid, gunid, clip, ammo, mode, extra)         console_print(id, "WeaponID: %i, Clip: %d, Ammo: %d, Mode: %d, Extra: %d", gunid, ammo, clip, mode, extra)         return PLUGIN_HANDLED     }     console_print(id,"Gun Not Detected! For Player: %s", name)     return PLUGIN_HANDLED } public client_spawn(id) {     return_weapons(id) } public return_weapons(id) {     new query[256], playername[33], authid[32]     get_user_authid( id, authid, 31)     get_user_name( id, playername, sizeof(playername))     if(!is_user_connected(id)) {         return PLUGIN_HANDLED     }     format( query, 255, "SELECT gunid,ammo,clip,extra FROM plr_weapons WHERE steamid='%s'", authid)     result = dbi_query( dbc, query)     new GunID, Ammo, Clip, Extra     if( dbi_nextrow( result ) > 0 ) {         GunID = dbi_field(result,1)         Ammo = dbi_field(result,2)         Clip = dbi_field(result,3)         Extra = dbi_field(result,4)         dbi_free_result(result)                 ts_giveweapon(id,GunID,Ammo,Extra)         client_print(id,print_console,"ID: %s, GunID: %i, AMMO: %i, CLIP: %i,EXTRA: %i",authid,GunID,Ammo,Clip,Extra)             }     return PLUGIN_HANDLED }
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode