Jump to content

help pls !! Replace Skin


Annas

Recommended Posts

Help me pls .

i think my dream is hard .. :( , but i'll tell you what i want ..

Function Replace() 
local Account Name = getPlayerAccount (USERNAME) 
if (Account Name) then 
txd = engineLoadTXD ( "infernus.txd" ) 
engineImportTXD ( txd, 411) 
end 
addCommandHandler("vehskin" , Replace) 

i wish you understand me i wanna only a username can do this command (vehskin) and if he do the TXD vehicle of Infernus will changed (only for me)

(i dont wanna it for Acl Group)

if you help me (and thx) i wanna the SERVER side (if it have) and the CLIENT side (if it have) , and the meta :mrgreen: and thx <3

Link to comment

is client side

engineImportTXD  

is serverSide

getPlayerAccount  

Maybe, Maybe, do it any other way

try use the function to serverSide, and import to ClientSite

if (isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(playersource)), aclGetGroup("Admin")))  then 

Link to comment

you didn't understand , i wanna complete SCRIPT pls ..

and as what i say

Function Replace() 
local Account Name = getPlayerAccount (USERNAME) 
if (Account Name) then 
txd = engineLoadTXD ( "infernus.txd" ) 
engineImportTXD ( txd, 411) 
end 
addCommandHandler("vehskin" , Replace) 

Link to comment

You can't write it like this because getPlayerAccount() it's a server side function so all what you need is :

triggerClientEvent() 

example :

-- Server side

  
function replace (player) 
     if not isElement(player) then return end  
     local account  = getPlayerAccount (player) 
     if not  isGuestAccount ( account ) then 
     local accName = getAccountName(account) 
     if accName == " YOUR ACCOUNT NAME " then 
     triggerClientEvent(player,"Replace",player) 
     else 
     outputChatBox ("sorry you can use this command!",player,255,0,0) 
     end  
end  
addCommandHandler("vehskin" ,replace) 
  

 

-- Client side

  
function replace () 
    txd = engineLoadTXD ( "infernus.txd" ) 
    engineImportTXD ( txd, 411) 
end  
addEvent("Replace",true) 
addEventHandler("Replace",root,replace) 
  

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...