21.06.2010, 20:34
Код:
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); } } SendClientMessage(playerid,LIME, ".::[VEHICLE]::. Vehicle is Locked!"); new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid,X,Y,Z); PlayerPlaySound(playerid,1057,X,Y,Z); Vehicle[GetPlayerVehicleID(playerid)][IsLocked] = 1; } } 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); } SendClientMessage(playerid,LIME, ".::[VEHICLE]::. Vehicle is Unlocked!"); 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; }