PDA

View Full Version : CMD:PVLOCK cmd..


Gregory00
04/12/2013, 02:06 PM
Hello guys,
I downloaded a script..The pvlock is bugged.. (E-LOCK SYSTEM) When the owner types /pvlock (and he has the pvlock) the player who tries to enter the vehicle get shocked. Can you please help me?

THANK YOU!!

(idk which one is the ELOCK but if you have this script and you fixed it please help me:) )
CMD:pvlock(playerid, params[])
{
new Float: x, Float: y, Float: z;
if(PlayerInfo[playerid][pVehicleKeysFrom] != INVALID_PLAYER_ID)
{
new ownerid = PlayerInfo[playerid][pVehicleKeysFrom];
if(IsPlayerConnected(ownerid))
{
new d = PlayerInfo[playerid][pVehicleKeys];
if(PlayerVehicleInfo[ownerid][d][pvId] != INVALID_PLAYER_VEHICLE_ID) GetVehiclePos(PlayerVehicleInfo[ownerid][d][pvId], x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
{
if(PlayerVehicleInfo[ownerid][d][pvLock] > 0)
{
if(PlayerVehicleInfo[ownerid][d][pvLocked] == 0)
{
GameTextForPlayer(playerid,"~r~Vehicle Locked!",5000,6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
PlayerVehicleInfo[ownerid][d][pvLocked] = 1;
LockPlayerVehicle(ownerid, PlayerVehicleInfo[ownerid][d][pvId], PlayerVehicleInfo[ownerid][d][pvLock]);
return 1;
}
else
{
GameTextForPlayer(playerid,"~g~Vehicle Unlocked!",5000,6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
PlayerVehicleInfo[ownerid][d][pvLocked] = 0;
UnLockPlayerVehicle(ownerid, PlayerVehicleInfo[ownerid][d][pvId], PlayerVehicleInfo[ownerid][d][pvLock]);
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You don't have a lock system installed on this vehicle.");
return 1;
}
}
}
}
for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
{
if(PlayerVehicleInfo[playerid][d][pvId] != INVALID_PLAYER_VEHICLE_ID) GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
{
if(PlayerVehicleInfo[playerid][d][pvLock] > 0 && PlayerVehicleInfo[playerid][d][pvLocked] == 0)
{
GameTextForPlayer(playerid,"~r~Vehicle Locked!",5000,6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
PlayerVehicleInfo[playerid][d][pvLocked] = 1;
LockPlayerVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId], PlayerVehicleInfo[playerid][d][pvLock]);
return 1;
}
else if(PlayerVehicleInfo[playerid][d][pvLock] > 0 && PlayerVehicleInfo[playerid][d][pvLocked] == 1)
{
GameTextForPlayer(playerid,"~g~Vehicle Unlocked!",5000,6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
PlayerVehicleInfo[playerid][d][pvLocked] = 0;
UnLockPlayerVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId], PlayerVehicleInfo[playerid][d][pvLock]);
return 1;

}
SendClientMessageEx(playerid, COLOR_GREY, " You don't have a lock system installed on this vehicle.");
return 1;
}
}
SendClientMessageEx(playerid, COLOR_GREY, " You are not near any vehicle that you own.");
return 1;
}

Gregory00
04/12/2013, 02:37 PM
Someone?

Gregory00
04/12/2013, 03:49 PM
hello?