Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addCmds ( hitElement )
- if ( getElementType ( hitElement ) == "vehicle" ) then
- if( getElementModel ( hitElement ) == 535 ) then
- addCommandHandler ( "addsaftvanmod", slamvanMod )
- else
- outputChatBox ( "You need a vehicle to access the mod shop", source, 255, 0, 0 )
- end
- else
- outputChatBox ( "You already have a Slamvan modded.", source, 255, 0, 0 )
- end
- end
- addEventHandler( "onMarkerHit", tbomstore, addCmds )
- function removeCmds ( leftElement )
- if ( getElementType ( leftElement ) == "vehicle" ) then
- if( getElementModel ( leftElement ) == 535 ) then
- removeCommandHandler ( "addsaftvanmod", slamvanMod )
- else
- outputChatBox ( "You need a vwouehicle to access the mod shop", source, 255, 0, 0 )
- end
- end
- end
- addEventHandler( "onMarkerLeave", tbomstore, removeCmds )
- function slamvanMod ( source )
- if ( isPedInVehicle ( source ) ) then
- if not getElementData( source, "moddedAlready" ) == 1 then
- if ( getElementModel ( getPedOccupiedVehicle ( source ) ) == 535 ) then
- setElementData(getPedOccupiedVehicle(source), "moddedAlready", false )
- saftslamvanhood = createObject( 1005, 0, 0, -2000 )
- saftslamvanspoiler = createObject( 1001, 0, 0, -2000 )
- saftslamvanroof = createObject( 1006, 0, 0, -2000 )
- saftslamvanbv = createObject( 1143, 0, 0, -200 )
- saftslamvanbv2 = createObject( 1143, 0, 0, -2000 )
- attachElements(saftslamvanbv, getPedOccupiedVehicle( source ), 0.70, -1.85, 0.39, 0, 0)
- attachElements(saftslamvanspoiler, getPedOccupiedVehicle( source ), 0, -2.4, 0.4)
- attachElements(saftslamvanroof, getPedOccupiedVehicle( source ), 0, 0.2, 0.77)
- attachElements(saftslamvanhood, getPedOccupiedVehicle( source ), 0, 1.4, 0.42)
- attachElements(saftslamvanbv2, getPedOccupiedVehicle( source ), -0.70, -1.85, 0.39, 0, 0)
- outputChatBox ( "Slamvan mod was added successfully!", source, 0, 255, 0 )
- else
- outputChatBox ( "This vehicle is not a Slamvan.", source, 255, 0, 0 )
- end
- else
- outputChatBox ( "Thie vehicle is already modded.", source, 255, 0, 0 )
- end
- else
- outputChatBox ( "You are not inside a Slamvan.", source, 0, 255, 0 )
- end
- end
- function destroySlamvanMod ( source )
- for _,object in ipairs (getAttachedElements(getPedOccupiedVehicle( source ) ) ) do
- destroyElement ( saftslamvanhood )
- destroyElement ( saftslamvanspoiler )
- destroyElement ( saftslamvanroof )
- destroyElement ( saftslamvanbv )
- destroyElement ( saftslamvanbv2 )
- outputChatBox ( "Slamvan mod was removed successfully!", source, 0, 255, 0 )
- end
- end
- addEventHandler ( "onPlayerLogout", getRootElement(), destroySlamvanMod )
- addCommandHandler ( "removesaftvanmod", destroySlamvanMod )
Add Comment
Please, Sign In to add comment