What is wrong? :|
#1

Hi all, i make this command on dialog, but in game not work, i don;t have errors in pawno
CMD:
PHP код:
if(strcmp(cmd"/lock"true) == 0)
    {
    new 
query[128];
            if(
SwitchKey[playerid] == 1)
            {
                new 
carid PlayerData[playerid][pPcarkey];
                if(
CarData[carid][cLockk] == 0)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Masina personala a fost incuiata.");
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
CarData[carid][cLockk] = 1;
                    
VehLocked[carid+PreVehicle] = 1;
                    
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,1,bonnet,boot,objective);
                    
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d",CarData[carid][cLockk], carid);
                
mysql_query(query);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Masina personala a fost descuiata.");
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
CarData[carid][cLockk] = 0;
                    
VehLocked[carid+PreVehicle] = 0;
                    
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,0,bonnet,boot,objective);
            
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                
mysql_query(query);
                    return 
1;
                }
            }
            if(
SwitchKey[playerid] == 2)
            {
                new 
carid PlayerData[playerid][pPcarkey2];
                if(
CarData[carid][cLockk] == 0)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Motocicleta personala a fost incuiata.");
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
CarData[carid][cLockk] = 1;
                    
VehLocked[carid+PreVehicle] = 1;
                    
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,1,bonnet,boot,objective);
                
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                
mysql_query(query);
                    return 
1;
                }
                else
                {
                   
SendClientMessage(playeridCOLOR_GRAD1"Motocicleta personala a fost descuiata.");
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
CarData[carid][cLockk] = 0;
                    
VehLocked[carid+PreVehicle] = 0;
                    
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,0,bonnet,boot,objective);
                    
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                
mysql_query(query);
                    return 
1;
                }
            }
            if(
SwitchKey[playerid] == 3)
            {
                new 
carid PlayerData[playerid][pPcarkey3];
                if(
CarData[carid][cLockk] == 0)
                {
                
SendClientMessage(playeridCOLOR_GRAD1"Barca/avionul a fost descuiat/a.");
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
CarData[carid][cLockk] = 1;
                    
VehLocked[carid+PreVehicle] = 1;
                    
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,1,bonnet,boot,objective);
                                
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                
mysql_query(query);
                    return 
1;
                }
                else
                {
                   
SendClientMessage(playeridCOLOR_GRAD1"Barca/avionul a fost incuiat/a.");
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
CarData[carid][cLockk] = 0;
                    
VehLocked[carid+PreVehicle] = 0;
                    
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,0,bonnet,boot,objective);
                                
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                
mysql_query(query);
                    return 
1;
                }
            }
            else if(
SwitchKey[playerid] == 4)
            {
                new 
carid HireCar[playerid];
                if(
CarLocked[HireCar[playerid]] == 0)
                {
                   
SendClientMessage(playeridCOLOR_GRAD1"Masina inchiriata a fost descuiata.");
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
CarLocked[HireCar[playerid]] = 1;
                    
VehLocked[carid] = 1;
                    
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(carid,engine,lights,alarm,1,bonnet,boot,objective);
                    return 
1;
                }
                else
                {
                        
SendClientMessage(playeridCOLOR_GRAD1"Masina inchiriata a fost incuiata.");
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
CarLocked[HireCar[playerid]] = 0;
                    
VehLocked[carid] = 0;
                    
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(carid,engine,lights,alarm,0,bonnet,boot,objective);
                    return 
1;
                }
            }
            
            else
            {
                
SendClientMessage(playeridCOLOR_PURPLE"Nu ai chei pe acest slot,scrie /switchkey!");
                return 
1;
            }
    } 
now i make on dialog CMD:
PHP код:
if(strcmp(cmd"/lock1"true) == 0)
    {
        
ShowPlayerDialog(playerid,DIALOG_MASINI,DIALOG_STYLE_LIST,"Masini personale:","1. Masina\n2. Motocicleta\n3. Helicopter","Ok","Close");
        return 
1;
    } 
OnDialogResponse


PHP код:
if(dialogid == DIALOG_MASINI)
        {
            if(
response)
            {
                if(
listitem == 0)
                {
                    new 
query[128];
                    if(
SwitchKey[playerid] == 1)
                    {
                        new 
carid PlayerData[playerid][pPcarkey];
                        if(
CarData[carid][cLockk] == 0)
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"Masina personala a fost incuiata.");
                            
PlayerPlaySound(playerid11450.00.00.0);
                            
CarData[carid][cLockk] = 1;
                            
VehLocked[carid+PreVehicle] = 1;
                            
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,1,bonnet,boot,objective);
                            
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d",CarData[carid][cLockk], carid);
                        
mysql_query(query);
                            return 
1;
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"Masina personala a fost descuiata.");
                            
PlayerPlaySound(playerid11450.00.00.0);
                            
CarData[carid][cLockk] = 0;
                            
VehLocked[carid+PreVehicle] = 0;
                            
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,0,bonnet,boot,objective);
                        
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                        
mysql_query(query);
                            return 
1;
                        }
                    }
                }
                if(
listitem == 1)
                {
                    new 
query[128];
                    if(
SwitchKey[playerid] == 2)
                    {
                        new 
carid PlayerData[playerid][pPcarkey2];
                        if(
CarData[carid][cLockk] == 0)
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"Motocicleta personala a fost incuiata.");
                            
PlayerPlaySound(playerid11450.00.00.0);
                            
CarData[carid][cLockk] = 1;
                            
VehLocked[carid+PreVehicle] = 1;
                            
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,1,bonnet,boot,objective);
                        
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                        
mysql_query(query);
                            return 
1;
                        }
                        else
                        {
                           
SendClientMessage(playeridCOLOR_GRAD1"Motocicleta personala a fost descuiata.");
                            
PlayerPlaySound(playerid11450.00.00.0);
                            
CarData[carid][cLockk] = 0;
                            
VehLocked[carid+PreVehicle] = 0;
                            
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,0,bonnet,boot,objective);
                            
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                        
mysql_query(query);
                            return 
1;
                        }
                    }
                }
                if(
listitem == 2)
                {
                    new 
query[128];
                    if(
SwitchKey[playerid] == 3)
                    {
                        new 
carid PlayerData[playerid][pPcarkey3];
                        if(
CarData[carid][cLockk] == 0)
                        {
                        
SendClientMessage(playeridCOLOR_GRAD1"Barca/avionul a fost descuiat/a.");
                            
PlayerPlaySound(playerid11450.00.00.0);
                            
CarData[carid][cLockk] = 1;
                            
VehLocked[carid+PreVehicle] = 1;
                            
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,1,bonnet,boot,objective);
                                        
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                        
mysql_query(query);
                            return 
1;
                        }
                        else
                        {
                           
SendClientMessage(playeridCOLOR_GRAD1"Barca/avionul a fost incuiat/a.");
                            
PlayerPlaySound(playerid11450.00.00.0);
                            
CarData[carid][cLockk] = 0;
                            
VehLocked[carid+PreVehicle] = 0;
                            
GetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(carid+PreVehicle,engine,lights,alarm,0,bonnet,boot,objective);
                                        
format(querysizeof(query), "UPDATE cars SET Lockk='%d' WHERE id=%d"CarData[carid][cLockk], carid);
                        
mysql_query(query);
                            return 
1;
                        }
                    }
                }
                if(
listitem == 3)
                {
                    
                    if(
SwitchKey[playerid] == 4)
                    {
                        new 
carid HireCar[playerid];
                        if(
CarLocked[HireCar[playerid]] == 0)
                        {
                        
SendClientMessage(playeridCOLOR_GRAD1"Masina inchiriata a fost descuiata.");
                            
PlayerPlaySound(playerid11450.00.00.0);
                            
CarLocked[HireCar[playerid]] = 1;
                            
VehLocked[carid] = 1;
                            
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(carid,engine,lights,alarm,1,bonnet,boot,objective);
                            return 
1;
                        }
                        else
                        {
                                
SendClientMessage(playeridCOLOR_GRAD1"Masina inchiriata a fost incuiata.");
                            
PlayerPlaySound(playerid11450.00.00.0);
                            
CarLocked[HireCar[playerid]] = 0;
                            
VehLocked[carid] = 0;
                            
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(carid,engine,lights,alarm,0,bonnet,boot,objective);
                            return 
1;
                        }
                    }
                }
            }
        } 
But why not work ? !!!!!
Reply
#2

What kind of a system did you use when making this script? Linux or Windows?
Reply
#3

Windows why?
Reply
#4

anyboby can help me ?
Reply
#5

When you compiled the script does it works fine ?
Reply
#6

Yes, i dont't have errors!
Reply
#7

I'm done, thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)