Loading players weapons - 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: Loading players weapons (
/showthread.php?tid=309752)
Loading players weapons -
Snowman12 - 08.01.2012
Hey,
I am trying to load a players weapons however I cannot figure out how could someone show me the way it's done? I use MySQL for my file saving.
Thanks,
-Snowman
Re: Loading players weapons -
Tanush123 - 09.01.2012
Do you exactly make weapons save on disconnect? if so under your onplayerdisconnect add
pawn Code:
format(query,sizeof(query),"UPDATE acc SET Weapon1 = %d",GetPlayerWeapon(playerid));
mysql_query(playerid);
you must have some strval field on player log so something like
pawn Code:
PlayerData[playerid][Weapon1] = strval(field[0]);
and onplayerspawn
pawn Code:
GivePlayerWeapon(playerid,PlayerData[playerid][Weapon1],5000);
hope you get me xD