12.11.2016, 17:02
Okay I want to make /createdrugs cmd and it is creating it and everything.
How can I make that Id increase everytime I type command. Table ID has Auto-Increasment..
Don't laught to me I am begginer
PHP код:
CMD:createdrugs(playerid)
{
if(PlayerInfo[playerid][Admin] < 5)
{
ERROR(playerid, "You are not allowed to use that command");
return 1;
}
new Float:X, Float:Y, Float:Z, place, query[128];
GetPlayerPos(playerid, X, Y, Z);
DrugsPickup[place] = CreateDynamicPickup(1279, 1, X, Y, Z);
DrugsLabel[place] = CreateDynamic3DTextLabel(""SERVERBLUE"[ DRUGS ]\n"WHITE"To buy drugs type /buydrugs", 0x1D9F00AA, X, Y, Z, 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 20.0);
DrugsInfo[place][ID] = cache_insert_id();
DrugsInfo[place][dPosX] = X;
DrugsInfo[place][dPosY] = Y;
DrugsInfo[place][dPosZ] = Z;
mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `drugs` (`ID`, `X`, `Y`, `Z`) VALUES (%d, %f, %f, %f)", cache_insert_id(), X, Y, Z);
mysql_tquery(g_SQL, query);
return 1;
}
Don't laught to me I am begginer