help|I need help
#1

I have bug on this code:
PHP код:
else if(!strcmp(x_v"lock",true))
{
if(
ProxDetectorV(10playeridveh1[playerid]))
{
//if(VehicleInfo[veh1[playerid]][vLockBuyed] == 0)
// return SendClientMessage(playerid, COLOR_WHITE," Your vehicle doesn`t have lock use /v buylock");
if(VehicleInfo[veh1[playerid]][vLock])
{
VehicleInfo[veh1[playerid]][vLock] = 0;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[veh1[playerid]] = 0;
UnLockCar(veh1[playerid]);
SaveVehicles(playeridveh1[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~g~Unlocked"VehicleNames[GetVehicleModel(veh1[playerid])-400]);
GameTextForPlayer(playeridstr70005);
format(stringsizeof(string), "* %s unlocks his %s."sendername ,VehicleNames[GetVehicleModel(veh1[playerid])-400]);
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 
1;
}
else
{
VehicleInfo[veh1[playerid]][vLock] = 1;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[veh1[playerid]] = 1;
LockCar(veh1[playerid]);
SaveVehicles(playeridveh1[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~r~Locked"VehicleNames[GetVehicleModel(veh1[playerid])-400]);
GameTextForPlayer(playeridstr70005);
format(stringsizeof(string), "* %s locks his %s."sendername ,VehicleNames[GetVehicleModel(veh1[playerid])-400]);
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 
1;
}
}
else if(
ProxDetectorV(10playeridveh2[playerid]))
{
//if(VehicleInfo[veh2[playerid]][vLockBuyed] == 0)
// return SendClientMessage(playerid, COLOR_WHITE," Your vehicle doesn`t have lock use /v buylock");
if(VehicleInfo[veh2[playerid]][vLock])
{
VehicleInfo[veh2[playerid]][vLock] = 0;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[veh2[playerid]] = 0;
UnLockCar(veh2[playerid]);
SaveVehicles(playeridveh2[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~g~Unlocked"VehicleNames[GetVehicleModel(veh2[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
else
{
VehicleInfo[veh2[playerid]][vLock] = 1;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[veh2[playerid]] = 1;
LockCar(veh2[playerid]);
SaveVehicles(playeridveh2[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~r~Locked"VehicleNames[GetVehicleModel(veh2[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
}
else if(
ProxDetectorV(10playeridveh3[playerid]))
{
//if(VehicleInfo[veh3[playerid]][vLockBuyed] == 0)
// return SendClientMessage(playerid, COLOR_WHITE," Your vehicle doesn`t have lock use /v buylock");
if(VehicleInfo[veh3[playerid]][vLock])
{
VehicleInfo[veh3[playerid]][vLock] = 0;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[veh3[playerid]] = 0;
UnLockCar(veh3[playerid]);
SaveVehicles(playeridveh3[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~g~Unlocked"VehicleNames[GetVehicleModel(veh3[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
else
{
VehicleInfo[veh3[playerid]][vLock] = 1;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[veh3[playerid]] = 1;
LockCar(veh3[playerid]);
SaveVehicles(playeridveh3[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~r~Locked"VehicleNames[GetVehicleModel(veh3[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
}
else if(
ProxDetectorV(10playeridveh4[playerid]))
{
//if(VehicleInfo[veh4[playerid]][vLockBuyed] == 0)
// return SendClientMessage(playerid, COLOR_WHITE," Your vehicle doesn`t have lock use /v buylock");
if(VehicleInfo[veh4[playerid]][vLock])
{
VehicleInfo[veh4[playerid]][vLock] = 0;
gCarLock[veh4[playerid]] = 0;
UnLockCar(veh4[playerid]);
SaveVehicles(playeridveh4[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~g~Unlocked"VehicleNames[GetVehicleModel(veh4[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
else
{
VehicleInfo[veh4[playerid]][vLock] = 1;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[veh4[playerid]] = 1;
LockCar(veh4[playerid]);
SaveVehicles(playeridveh4[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~r~Locked"VehicleNames[GetVehicleModel(veh4[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
}
else if(
ProxDetectorV(10playeridveh5[playerid]))
{
//if(VehicleInfo[veh5[playerid]][vLockBuyed] == 0)
// return SendClientMessage(playerid, COLOR_WHITE," Your vehicle doesn`t have lock use /v buylock");
if(VehicleInfo[veh5[playerid]][vLock])
{
VehicleInfo[veh5[playerid]][vLock] = 0;
gCarLock[veh5[playerid]] = 0;
UnLockCar(veh5[playerid]);
SaveVehicles(playeridveh5[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~g~Unlocked"VehicleNames[GetVehicleModel(veh5[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
else
{
VehicleInfo[veh5[playerid]][vLock] = 1;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[veh5[playerid]] = 1;
LockCar(veh5[playerid]);
SaveVehicles(playeridveh5[playerid]);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~r~Locked"VehicleNames[GetVehicleModel(veh5[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
}
else
{
if(
PlayerInfo[playerid][pPcarkey] != 999 || PlayerInfo[playerid][pPcarkey2] != 999 || PlayerInfo[playerid][pPcarkey3] != 999)
{
for(new 
iv 0iv MAX_VEHICLESiv++)
{
if(
ProxDetectorV(10playeridiv))
{
if(
VehicleInfo[iv][vOwned] == 1)
{
if(!
strcmp(PlayerInfo[playerid][pPcarkey], VehicleInfo[iv][vKey], true) || !strcmp(PlayerInfo[playerid][pPcarkey2], VehicleInfo[iv][vKey], true)
||!
strcmp(PlayerInfo[playerid][pPcarkey3], VehicleInfo[iv][vKey], true))
{
VehicleInfo[iv][vLock] = 1;
PlayerPlaySound(playerid11450.00.00.0);
gCarLock[iv] = 1;
LockCar(iv);
SaveVehicles(playeridiv);
new 
str[256];
format(strsizeof(str), "~y~%s ~n~~r~Locked"VehicleNames[GetVehicleModel(veh5[playerid])-400]);
GameTextForPlayer(playeridstr70005);
return 
1;
}
}
}
}
}
return 
1;
}

When I lock my car and then going into interrior and then get out my car is unlocked please help me
Reply
#2

Repost it and use :
[ pawn ] Code here [/ pawn]

[Doppeyy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)