Problem with mysql
#1

i have this error's

PHP код:
C:\Documents and Settings\##\Desktop\asa\gamemodes\.pwn(4354) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\##\Desktop\asa\gamemodes\.pwn(13767) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\##\Desktop\asa\gamemodes\.pwn(13811) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\##\Desktop\asa\gamemodes\.pwn(21219) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\##\Desktop\asa\gamemodes\.pwn(21309) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
5 Errors

here are the lines:

PHP код:
           line 4354    format(queryEXsizeof(queryEX), "UPDATE `business` SET `owned`='0',`owner`='The Government',`bank`='0',`products`='9999999',`prodpay`='0',`workers`='0' WHERE `id`='%d';"strval(resultEX));
                
mysql_query(queryEX);
                
format(queryEXsizeof(queryEX), "`id`='%d';"strval(resultEX));
                
stringEX=mysql_GetStr("`business`","`name`",queryEX);
                for(new 
0!= MAX_PLAYERSi++)
                {
                    if(
IsPlayerConnected(i))
                    {
                        if(!
strcmp(stringEXplayerinfo[i][cworkon],true))
                        {
                            
playerinfo[i][workon] = 0;
                            
format(playerinfo[i][cworkon], 128"None");
                            
SendClientMessage(iCOLOR_RED"The business you were working at has been sold to The Government. You are no longer working for it!");
                        }
                    }
        
line 4366    }
    
line 13765    }
            
format(queryEX,MAX_STRING1,"`vid`='%d'",GetPlayerVehicleID(user));
            
String=mysql_GetStr("vehicles","owner",queryEX);
            if(
strcmp(String,playerinfo[user][playername])){
                
SendClientMessage(playerid,COLOR_GREY,"The player has to be inside the car.");
                return 
1;
    
line 13771    }
line 13793
    
if(!IsPlayerInAnyVehicle(playerid)){
            
SendClientMessage(playerid,COLOR_GREY,"You have to be inside a buyable vehicle.");
            return 
1;
    }
    
// WE NEED SOME BIG ASS LOG OF EVERYTHING IN HERE SO WE MAKE SURE EVERYTHING IS WORKING FINE
    
getdate(yearEX,monthEX,dayEX);
    
gettime(hourEX,minEX,secEX);
    
format(queryEX,256,"INSERT INTO `donatorlog` (`user`,`action`,`ticketsold`,`ticketsnew`,`time`) VALUES ('%s','usevehticket','%d','%d','%d/%d/%d - %d:%d:%d');",playerinfo[playerid][playername2],playerinfo[playerid][vehicleticket],playerinfo[playerid][vehicleticket]-1,yearEX,monthEX,dayEX,hourEX,minEX,secEX);
    
mysql_query(queryEX);
    
// id=GetPlayerVehicleID(playerid); // needed?
    
f=-1;
    
format(queryEX,256,"`vid`='%d'",GetPlayerVehicleID(playerid));
    
f=mysql_GetInt("vehicles","vtype",queryEX);
    if(
f)
        return 
SendClientMessage(playerid,COLOR_GREY,"This vehicle is not for sale!");
    
f=mysql_GetInt("vehicles","id",queryEX);
    if(
f==-1)
        return 
SendClientMessage(playerid,COLOR_GREY,"This vehicle is not for sale!");
    
String=mysql_GetStr("vehicles","owner",queryEX);
    if(
strcmp(String,"No",true))
        return 
SendClientMessage(playerid,COLOR_GREY,"This vehicle is owned and not for sale!");
    if(
playerinfo[playerid][ownedcar]!=-1)
        return 
SendClientMessage(playerid,COLOR_RED,"You cannot own more than one vehicle");
    
playerinfo[playerid][vehicleticket]--;    // this way or with a direct mysql query?
    
playerinfo[playerid][ownedcar]=mysql_GetInt("vehicles","id",queryEX);
    
// format(queryEX,256,"UPDATE `vehicles` SET `donatorcar`='1' WHERE 
    
mysql_SetStr("vehicles","owner",playerinfo[playerid][playername],queryEX);
    
format(String,256,"%d/%d/%d",yearEX,monthEX,dayEX);
    
mysql_SetStr("vehicles","ddate",String,queryEX);
    
mysql_SetInt("vehicles","donatorcar",1,queryEX);
    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Congratulations, you've just purchased a vehicle! Catch the keys.");
    
SendClientMessage(playerid,COLOR_LIGHTYELLOW,"Your vehicle has been registered at the LSPD Database.");
    
SendClientMessage(playerid,COLOR_GREY,"Type /sreg [ID/PartOfName] to produce your registration.");
    
freeze(playerid,0);
    
SendClientMessage(playerid,COLOR_GREY,"Type /car for a detailed menu of your vehicle!");
    
SendClientMessage(playerid,COLOR_GREY,"You've used one vehicle ticket! This vehicle is yours for one month!");
    return 
1;
}
line 13830
line 21218
    
}
    
stringEX=mysql_GetStr("vehicles","owner",String);
    if(
strcmp(stringEX,"No",true)){
        
SendClientMessage(playerid,COLOR_GREY,"This vehicle has its owner. Not for sale!");
        return 
1;
    }
line 21223
line 21307
    
else if(!f)
    {
        
String=mysql_GetStr("vehicles","owner",String);
        if(
strcmp(String,playerinfo[playerid][playername]))
            return 
SendClientMessage(playerid,COLOR_GREY,"This is not your vehicle. No access to do this.");
        
freeze(playerid,1);
        
ShowMenuForPlayer(carmenu,playerid);
    }
line 21314 
Reply
#2

you shouldn't use 'string1 = string2', try using format or strmid.
Reply
#3

can you please give me an example because i 'm not good with pawno i have buy-ed this script :S
Reply
#4

pawn Код:
format( stringEX , sizeof(stringEX) , "%s" , mysql_GetStr("`business`","`name`",queryEX) );
See if this fixes the first error, then do the same with the other errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)