14.03.2012, 21:41
Vehicle doesn't lock, it says "Vehicle Locked" but when i get out, i enter it (Unlocked)
pawn Код:
dcmd_lock(playerid,params[]){
#pragma unused params
if(IsPlayerConnected(playerid) && Vehicle[GetPlayerVehicleID(playerid)][IsLocked] == 0){
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
for(new i = 0; i <MAX_PLAYERS; i++) { if (i != playerid) { SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1); } }
GameTextForPlayer(playerid,"~G~Vehicle locked",4000,3);
new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid,X,Y,Z);
PlayerPlaySound(playerid,1057,X,Y,Z); Vehicle[GetPlayerVehicleID(playerid)][IsLocked] = 1;
SetTimerEx("UnlockVehicle",600000,false,"i",GetPlayerVehicleID(playerid)); } }
return true;
}
dcmd_unlock(playerid,params[]){
#pragma unused params
if(IsPlayerConnected(playerid) && Vehicle[GetPlayerVehicleID(playerid)][IsLocked] == 1){
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
for(new i = 0; i <MAX_PLAYERS; i++) { SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0); }
GameTextForPlayer(playerid,"~G~Vehicle unlocked",4000,3);
new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid,X,Y,Z);
PlayerPlaySound(playerid,1057,X,Y,Z); Vehicle[GetPlayerVehicleID(playerid)][IsLocked] = 0; } }
return true;
}