Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(!ispassenger)
- {
- if(SAMD_Vehicle(vehicleid))
- {
- if(PlayerInfo[playerid][pTrabajo] != 1 || PlayerInfo[playerid][pTrabajo2] != 1)
- {
- RemovePlayerFromVehicle(playerid);
- new Float:slx, Float:sly, Float:slz;
- GetPlayerPos(playerid, slx, sly, slz);
- SetPlayerPos(playerid, slx, sly, slz);
- SendClientMessage(playerid, COLOR_WHITE, "Necesitas conseguir el trabajo de médico para conducir ambulancias.");
- SendClientMessage(playerid, COLOR_WHITE, "Usa "#Amarillo1"/ayuda trabajos "#Blanco"para obtener más información.");
- return 1;
- }
- }
- else if(LSPD_IsACopCar(vehicleid))
- {
- if(PlayerInfo[playerid][pPolicia] != 1 || PlayerInfo[playerid][pFaccion] != 1)
- {
- RemovePlayerFromVehicle(playerid);
- new Float:slx, Float:sly, Float:slz;
- GetPlayerPos(playerid, slx, sly, slz);
- SetPlayerPos(playerid, slx, sly, slz);
- SendClientMessage(playerid, COLOR_WHITE, "Necesitar ser policia y estar con el uniforme para conducir este vehículo.");
- return 1;
- }
- }
- else if(TRUCK_IsATrashMaster(vehicleid))
- {
- if(PlayerInfo[playerid][pTrabajo] != 5 || PlayerInfo[playerid][pTrabajo2] != 5)
- {
- RemovePlayerFromVehicle(playerid);
- new Float:slx, Float:sly, Float:slz;
- GetPlayerPos(playerid, slx, sly, slz);
- SetPlayerPos(playerid, slx, sly, slz);
- SendClientMessage(playerid, COLOR_WHITE, "Necesitar ser basurero para conducir camiones de basura.");
- SendClientMessage(playerid, COLOR_WHITE, "Escribe "#Amarillo1"/ayuda trabajos "#Blanco"para obtener más información.");
- return 1;
- }
- }
- else if(IsATruckerCar(vehicleid))
- {
- if(PlayerInfo[playerid][pTrabajo] != 4 || PlayerInfo[playerid][pTrabajo2] != 4)
- {
- RemovePlayerFromVehicle(playerid);
- new Float:slx, Float:sly, Float:slz;
- GetPlayerPos(playerid, slx, sly, slz);
- SetPlayerPos(playerid, slx, sly, slz);
- SendClientMessage(playerid, COLOR_WHITE, "Necesitar conseguir el trabajo de camionero para usar este vehículo.");
- SendClientMessage(playerid, COLOR_WHITE, "Escribe "#Amarillo1"/ayuda trabajos "#Blanco"para obtener más información.");
- return 1;
- }
- }
- else if(IsATruckerVipCar(vehicleid))
- {
- if(PlayerInfo[playerid][pTrabajo] != 4 || PlayerInfo[playerid][pTrabajo2] != 4 && PlayerInfo[playerid][pVIP] < 2)
- {
- RemovePlayerFromVehicle(playerid);
- new Float:slx, Float:sly, Float:slz;
- GetPlayerPos(playerid, slx, sly, slz);
- SetPlayerPos(playerid, slx, sly, slz);
- SendClientMessage(playerid, COLOR_WHITE, "Necesitar conseguir el trabajo de camionero y memebresía VIP2 para conducir este vehículo.");
- return 1;
- }
- }
- else if(!IsPlayerInRangeOfVehicle(playerid, vehicleid, 7.5) || LockStatus[vehicleid] >= 1){ // G-bugging fix
- ClearAnimations(playerid);
- }
- }
- if(!ispassenger && cocheocupado(vehicleid))
- {
- new Float:cjx, Float:cjy, Float:cjz;
- PlayerInfo[playerid][pMundoVirtual] = GetPlayerVirtualWorld(playerid);
- GetPlayerPos(playerid, cjx, cjy, cjz);
- SetPlayerPos(playerid, cjx, cjy, cjz);
- SendClientMessage(playerid, COLOR_WHITE, "No intentes robar coches sin rol, quedas congelado por 2 segundos.");
- TogglePlayerControllable(playerid, 0);
- TimerCongelado[playerid] = 3;
- ClearAnimations(playerid);
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
- ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
- ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
- SetPlayerVirtualWorld(playerid, random(999));
- }
- if(ispassenger)
- {
- for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new Float: Pos[3];
- GetVehiclePos(PlayerVehicleInfo[i][v][pvId], Pos[0],Pos[1],Pos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 7.0, Pos[0],Pos[1],Pos[2]))
- {
- if(PlayerVehicleInfo[i][v][pvLocked] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "El vehículo está cerrado, para destrabar las puertas el dueño tiene que "#Amarillo1"/abrir");
- }
- }
- }
- }
- }
- }
- if(!ispassenger)
- {
- for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new Float: Pos[3];
- GetVehiclePos(PlayerVehicleInfo[i][v][pvId], Pos[0],Pos[1],Pos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 7.0, Pos[0],Pos[1],Pos[2]))
- {
- if(PlayerVehicleInfo[i][v][pvLocked] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "El vehículo está cerrado, para destrabar las puertas el dueño tiene que "#Amarillo1"/abrir");
- }
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement