ID not valid
#22

Why are you using y_iterate already??

Why not just simply..

PHP код:
CMD:creategarage(playeridparams[])
{
    if(
Player[playerid][AdminLevel] < 5) return 0;
    new 
pricesize;
    if(
sscanf(params"dd(0)"pricesize))
    {
        
SCM(playeridCOLOR_BELGREEN"» [USAGE]: /creategarage [price] [size(default 0)]");
        return 
SCM(playeridCOLOR_BELGREEN"» Size: 0 - Small Garage , 1 - Medium Garage, 2 - Big Garage.");
    }
    if((
size 0) || (size 2)) return SCM(playeridCOLOR_ERROR"» Size must be from 0 to 2.");
    if((
price 1) || (price 999999)) return SCM(playeridCOLOR_ERROR"» Invalid price.");
    for(new 
1MAX_GARAGESi++)
    {
        if(!
GarageInfo[i][garageExists])
        {
            
GarageInfo[i][garageID] = i;
            new 
query[300];
            
mysql_format(g_SQLquerysizeof query"INSERT INTO `garages` (`garagePrice`, `garageSize`) VALUES ('%d', '%d')"pricesize);
            
mysql_tquery(g_SQLquery"OnGarageCreated""d"i);
            
GarageInfo[i][garageExists] = true;
            
GetPlayerPos(playeridGarageInfo[i][garagePos][0], GarageInfo[i][garagePos][1], GarageInfo[i][garagePos][2]);
            
GetPlayerFacingAngle(playeridGarageInfo[i][garagePos][3]);
            
GarageInfo[i][garagePos][0] = GarageInfo[i][garagePos][0] + (1.5 floatsin(-GarageInfo[i][garagePos][3], degrees));
            
GarageInfo[i][garagePos][1] = GarageInfo[i][garagePos][1] + (1.5 floatcos(-GarageInfo[i][garagePos][3], degrees));
            
GarageInfo[i][garageVW] = GetPlayerVirtualWorld(playerid);
            
GarageInfo[i][garagePrice] = price;
            
GarageInfo[i][garageSize] = size;
            
RefreshGarage(i);
            
SCMEX(playeridCOLOR_YELLOW"» You have successfully created a garage. ID: %d - Price: %s - Size: %d"iformatInt(price), size);
            
            
printf("Garage is saved for i: %d"i);
            if(
== -1) return SCM(playeridCOLOR_ERROR"» The server has reached the limit for garages.");
            return 
1;
        }
    }    

PHP код:
function OnQueryFinished(extraidthreadid)
{
    switch(
threadid)
    {
        case 
THREAD_CREATE_GARAGE:
        {
            
GarageInfo[extraid][garageID] = extraid;
            
SaveGarage(extraid);
        }
    }
    return 
1;

i believe that would do enough, no need for the y_iterate.
Reply


Messages In This Thread
ID not valid - by SymonClash - 22.02.2019, 10:19
Re: ID not valid - by CherryMond - 22.02.2019, 14:14
Re: ID not valid - by SymonClash - 22.02.2019, 14:17
Re: ID not valid - by TheToretto - 22.02.2019, 14:30
Re: ID not valid - by SymonClash - 22.02.2019, 14:38
Re: ID not valid - by TheToretto - 22.02.2019, 15:05
Re: ID not valid - by SymonClash - 22.02.2019, 19:06
Re: ID not valid - by TheToretto - 22.02.2019, 19:51
Re: ID not valid - by SymonClash - 22.02.2019, 20:39
Re: ID not valid - by TheToretto - 22.02.2019, 21:40
Re: ID not valid - by Pottus - 22.02.2019, 21:54
Re: ID not valid - by TheToretto - 22.02.2019, 22:12
Re: ID not valid - by Pottus - 22.02.2019, 22:58
Re: ID not valid - by SymonClash - 22.02.2019, 23:30
Re: ID not valid - by TheToretto - 23.02.2019, 09:36
Re: ID not valid - by SymonClash - 23.02.2019, 11:05
Re: ID not valid - by TheToretto - 23.02.2019, 12:23
Re: ID not valid - by SymonClash - 23.02.2019, 12:34
Re: ID not valid - by TheToretto - 23.02.2019, 13:46
Re: ID not valid - by SymonClash - 23.02.2019, 14:20
Re: ID not valid - by SymonClash - 24.02.2019, 19:09
Re: ID not valid - by JasonRiggs - 24.02.2019, 19:40
Re: ID not valid - by SymonClash - 24.02.2019, 21:06
Re: ID not valid - by JasonRiggs - 24.02.2019, 21:36
Re: ID not valid - by SymonClash - 25.02.2019, 13:05

Forum Jump:


Users browsing this thread: 4 Guest(s)