Jump to content

help important


nasserdfdd

Recommended Posts

hi all so i made a vehicle mod for a people with acl admin but when i start and enter veh no error or change in vehicle

script

function enterVehicle () 
    if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then 
    txd = engineLoadTXD("infernus.txd", 411 ) --this is veh id  
    engineImportTXD(txd, 411) 
    dff = engineLoadDFF("infernus.dff", 411 ) 
    engineReplaceModel(dff, 411) 
    else 
    outputChatBox("Only acl admin have shader", 0, 255, 0, false) 
    end 
end 
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle )  

Link to comment

Dude; you're wrong,

-Put this part only in client side since it's client sided only.

 txd = engineLoadTXD("infernus.txd", 411 ) --this is veh id  
    engineImportTXD(txd, 411) 
    dff = engineLoadDFF("infernus.dff", 411 ) 
    engineReplaceModel(dff, 411) 

and other part is server side only, so you have to put it in server side, be carefull.

-Don't forget to add them to META,and you didn't explain your problem as well, also i didn't understand what you trying to do

Link to comment

sorry can u make it for me

meta

  "nasser." version="1.0" name="inferus mod for admin" type="misc" />  
  

inf_c.lua

function enterVehicle () 
    if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then 
    txd = engineLoadTXD("infernus.xd", 411 ) 
    engineImportTXD(txd, 411) 
    dff = engineLoadDFF("infernus.dff", 411 ) 
    engineReplaceModel(dff, 411) 
    else 
    outputChatBox("Only acl admin have shader", 0, 255, 0, false) 
    end 
end 
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle )  

can u make it for me cuz i did not understand u

edit:i want the mod only for acl admin but every one see the modded of the admin vehicle when he enter it if u did not understand pls tell me

Link to comment

These functions are server side only and you put them in client side,so it will not works.

What i understand from what you trying to do, is you want let only the player who is in ACL he who can use the vehicle ?

isObjectInACLGroup  
  getAccountName  
  getPlayerAccount  
  aclGetGroup  

Edited by Guest
Link to comment

You need to say if the admin will have an another vehicle of normal players, then you make like he said at client-side the code for load TXD/DFF for ALL and you only give this type of vehicle for players.

If you want different skins for same vehicle its not possible (u can but normal player will see their skin and not the admin skin, and admin skin will see player skin).

I hope ou will understand.

You need to be clear.

Link to comment

--server side:

local infernus = {[411]=true} 
addEventHandler ( "onVehicleStartEnter", crimainlTheftVehicle,  
function ( player, seat ) 
 if ( seat == 0 ) then  
 if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) then 
    local theVehicle = source 
    local vehModel = getElementModel(theVehicle) 
    if (infernus[vehModel]) then return end 
 else 
 cancelEvent ( )  
  outputChatBox ( "You cannot enter this vehicle,Only Admin can.", player, 255, 0, 0 )  
        end   
    end  
end) 

--client side:

addEventHandler ( "onClientResourceStart" , resourceRoot , 
    function ( ) 
        txd = engineLoadTXD("infernus.txd", 411 ) 
    engineImportTXD(txd, 411) 
    dff = engineLoadDFF("infernus.dff", 411 ) 
    engineReplaceModel(dff, 411) 
    end 
) 

--meta.xml should be like that:


Link to comment

Your scripting skills 92% awesome xD

local infernus = {[411]=true} 
addEventHandler ( "onVehicleStartEnter", root, 
function ( player, seat ) 
 if ( seat == 0 ) then 
 if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) then 
    local theVehicle = source 
    local vehModel = getElementModel(theVehicle) 
    if (infernus[vehModel]) then return end 
 else 
 cancelEvent ( ) 
  outputChatBox ( "You cannot enter this vehicle,Only Admin can.", player, 255, 0, 0 ) 
        end  
    end 
end) 

Link to comment

Client

  
function enterveh () 
    triggerServerEvent("check",localPlayer) 
    txd = engineLoadTXD("infernus.txd", 411 )  
    engineImportTXD(txd, 411) 
    dff = engineLoadDFF("infernus.dff", 411 ) 
    engineReplaceModel(dff, 411) 
    else 
    outputChatBox("Only acl admin have shader", 0, 255, 0, false) 
end 
addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), enterveh ) 

Server

  
function lol(thePlayer) 
if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then 
end 
end 
addEvent("check",true) 
addEventHandler("check",root,lol) 

Link to comment
function permission (player) 
local accName = getAccountName ( getPlayerAccount ( player ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
end 
end 
addEvent("check",true) 
addEventHandler("check",root,permission) 

ლ(ಠ益ಠ)ლ damn

Link to comment

i get this error

warrning test\server.lua:2: bad argument @ getplayeraccount' expected element at argument 1,got nil

warrning test\server.lua:2: bad argument @ getplayername' expected element at argument 1,got boolean

seond test\serverlua:3: attemept to concatentate local 'accname'(a boolean value)

Link to comment

ok

meta


server

function permission (player) 
local accName = getAccountName ( getPlayerAccount ( player ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
end 
end 
addEvent("check",true) 
addEventHandler("check",root,permission) 

client

  
function enterveh () 
    triggerServerEvent("check",localPlayer) 
    txd = engineLoadTXD("infernus.txd", 411 ) 
    engineImportTXD(txd, 411) 
    dff = engineLoadDFF("infernus.dff", 411 ) 
    engineReplaceModel(dff, 411) 
end 
addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), enterveh ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...