18.04.2013, 17:14
So when I just ride the car in it's position I can do /lockfcar when its on its position [where I created it], but when I just walk away from the position I wont be able to do /lockfcar it says that Im not near a familycar
Here's the code:
Here's the code:
pawn Код:
}
if(strcmp(cmd, "/lockfcar", true) == 0)
{
new sendername2[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, sendername2,MAX_PLAYER_NAME);
for(new fv=0;fv<MAX_FAMVEHICLES;fv++)
{
if(fVehicleInfo[fv][fvID] != 0 &&IsPlayerInRangeOfPoint(playerid, 5.0, fVehicleInfo[fv][fvX], fVehicleInfo[fv][fvY], fVehicleInfo[fv][fvZ]))
{
if(PlayerInfo[playerid][pFMember] == fVehicleInfo[fv][fvFam])
{
if(fVehicleInfo[fv][fvLocked] != 0)
{
fVehicleInfo[fv][fvLocked] = 0;
UnLockCar(fVehicleInfo[fv][fvID]);
format(string, sizeof(string), "* %s has unlocked the family car.", sendername2);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
if(fVehicleInfo[fv][fvLocked] == 0)
{
fVehicleInfo[fv][fvLocked] = 1;
LockCar(fVehicleInfo[fv][fvID]);
format(string, sizeof(string), "* %s has locked the family car.", sendername2);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
else
{
return SendClientMessage(playerid, COLOR_GREY," You're not in the family that owns this car !");
}
}
else
{
if(fv != MAX_FAMVEHICLES-1)
{
continue;
}
else
{
return SendClientMessage(playerid, COLOR_GREY," You're not near to any family car !");
}
}
}
return 1;
}