SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 17/03/2019, 01:51 PM   #1
Big Clucker
Join Date: Feb 2019
Posts: 72
Reputation: 0
Default data base help

i tried to script this part alone but it's my first time working with a database and i don't think i did it right,like this are giftbox locations and the status if its active or not,and this code is put under on gamemode init and when i restart the server and i use /getgift it places the checkpoint at a random location every time i restart the gamemode,not at the location i saved,and yes, the gift positions are saved in the database.

new qstr[256];
format(qstr,100,"SELECT * FROM giftbox WHERE `ID`='1'");
new Cache: giftinfo = mysql_query(SQL,qstr);
if(cache_get_row_count() > 0)
GiftInfo[1][gGiftPosX] = cache_get_field_content_float(0, "GiftPosX");
GiftInfo[1][gGiftPosY] = cache_get_field_content_float(0, "GiftPosX");
GiftInfo[1][gGiftPosZ] = cache_get_field_content_float(0, "GiftPosX");
GiftInfo[1][gActive] = cache_get_field_content_int(0, "Active");
bosmania is offline   Reply With Quote

Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql help data base thomasanderson73 Everything and Nothing 1 10/10/2015 07:14 PM
How to run MySQL Data Base NNek Everything and Nothing 7 15/06/2015 11:30 AM
Data base error? Seifspeed Scripting Help 6 11/04/2014 03:33 PM
SII data base save Jesper00 Scripting Help 2 30/11/2013 09:59 PM
SAMP SQL Data Base Help ((LINUX)) RoyalGaming Server Support 3 13/10/2013 07:10 AM

All times are GMT. The time now is 08:14 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.