Jump to content

some help .


sckatchof

Recommended Posts

hi guys i have make a clothes shop but when i worked in other work the skin change to skin job like police job and i want when i do /criminal my skin change to when i buy skin from clothes shop

server side :

criminalTeam = createTeam ("Criminal", 255, 0, 0) 
  
function joinTeam (thePlayer) 
    setPlayerTeam ( thePlayer, criminalTeam ) 
    setElementModel ( thePlayer, tonumber( getElementData( thePlayer, "clothesSkin" ) ) 
    outputChatBox ( "You are now a criminal.",source, 0, 255, 0 ) 
end 
addCommandHandler ("criminal", joinTeam) 

Link to comment
uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) 
  
function fJoinTeam ( uPlayer ) 
    setPlayerTeam ( uPlayer, uCriminalTeam ) 
    setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) ) ) 
    outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) 
end 
addCommandHandler ( 'criminal', fJoinTeam ) 

You forgot close function and in line 6 source is not defined.

Predefined variable source used only in function handler event.

Edited by Guest
Link to comment
uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) 
  
function fJoinTeam ( uPlayer ) 
    setPlayerTeam ( uPlayer, uCriminalTeam ) 
    setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) ) ) 
    outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) 
end 
addCommandHandler ( 'criminal', fJoinTeam ) 

You forgot close function and in line 6 source is not defined.

thnx for help but still dont work

Link to comment
  
uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) 
  
function fJoinTeam ( uPlayer ) 
    setPlayerTeam ( uPlayer, uCriminalTeam ) 
    setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) or 0 ) ) 
    outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) 
end 
addCommandHandler ( 'criminal', fJoinTeam ) 
  

Your data 'clothesSkin' not have value.

Edited by Guest
Link to comment
uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) 
  
function fJoinTeam ( uPlayer ) 
    setPlayerTeam ( uPlayer, uCriminalTeam ) 
    outputChatBox( '->' .. tostring( getElementData( uPlayer, 'clothesSkin' ) ) ) 
    setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) ) or 0 ) 
    outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) 
end 
addCommandHandler ( 'criminal', fJoinTeam ) 

Debug it.

I think your data 'clothesSkin' not defined.

Edited by Guest
Link to comment
uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) 
  
function fJoinTeam ( uPlayer ) 
    setPlayerTeam ( uPlayer, uCriminalTeam ) 
    outputChatBox( 'type' .. type( getElementData( uPlayer, 'clothesSkin' ) ) ) 
    assert( type( getElementData( uPlayer, 'clothesSkin' ) ) == 'number' ) 
    setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) or 0 ) ) 
    outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) 
end 
addCommandHandler ( 'criminal', fJoinTeam ) 

Debug it.

I think your data 'clothesSkin' not defined.

output : typestring

debugscript 3 : Error line 6 : assertion failed!

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