MySQL increase
#1

Okay I want to make /createdrugs cmd and it is creating it and everything.
PHP код:
CMD:createdrugs(playerid)
{
    if(
PlayerInfo[playerid][Admin] < 5)
    {
        
ERROR(playerid"You are not allowed to use that command");
        return 
1;
    }
    new 
Float:XFloat:YFloat:Zplacequery[128];
    
GetPlayerPos(playeridXYZ);
    
DrugsPickup[place] = CreateDynamicPickup(12791XYZ);
    
DrugsLabel[place] = CreateDynamic3DTextLabel(""SERVERBLUE"[ DRUGS ]\n"WHITE"To buy drugs type /buydrugs"0x1D9F00AAXYZ,  10.0INVALID_PLAYER_IDINVALID_VEHICLE_ID0, -1, -1, -120.0);
    
DrugsInfo[place][ID] = cache_insert_id();
    
DrugsInfo[place][dPosX] = X;
    
DrugsInfo[place][dPosY] = Y;
    
DrugsInfo[place][dPosZ] = Z;
    
mysql_format(g_SQLquerysizeof(query), "INSERT INTO `drugs` (`ID`, `X`, `Y`, `Z`) VALUES (%d, %f, %f, %f)"cache_insert_id(), XYZ);
    
mysql_tquery(g_SQLquery);
    return 
1;

How can I make that Id increase everytime I type command. Table ID has Auto-Increasment..

Don't laught to me I am begginer
Reply


Messages In This Thread
MySQL increase - by Micko123 - 12.11.2016, 17:02
Re: MySQL increase - by Konstantinos - 12.11.2016, 17:03
Re: MySQL increase - by Micko123 - 12.11.2016, 17:17
Re: MySQL increase - by Micko123 - 12.11.2016, 17:25
Re: MySQL increase - by oMa37 - 12.11.2016, 17:40
Re: MySQL increase - by Micko123 - 12.11.2016, 17:42
Re: MySQL increase - by oMa37 - 12.11.2016, 17:45
Re: MySQL increase - by Micko123 - 12.11.2016, 17:51

Forum Jump:


Users browsing this thread: 1 Guest(s)