16.05.2017, 02:10
Код:
CMD:vehlock(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; } }
The code continues after the '}' I just don't think that it's neccessary.
Anyways I have been trying to change it so whenever I unlock the vehicle it'll say the name of the vehicle and then unlocked (e.g: "Turismo Unlocked") and whenever I lock it it'll say the name of the vehicle and then locked (Turismo Locked).
I tried to edit this:
Код:
GameTextForPlayer(playerid,"~r~%s Locked!",5000,6, VehicleName[PlayerVehicleInfo[pvModelId] - 400]);
Код:
XXXX\XXXX\XXXX\XXXX.pwn(57967) : error 033: array must be indexed (variable "PlayerVehicleInfo") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Can anyone help me out?
If possible paste the code that it'll work don't only tell me what to do lol because I don't really know all the abbreviations lol.
Thanks!