bebo1king Posted January 9, 2016 Share Posted January 9, 2016 (edited) Hello, I was trying to make CJ edit his body muscle but it dont work My Code : function CjCreating () CJ = createPed (0,352.5,-256.29998779297,715,90) setElementDimension (CJ , 200) addPedClothes (CJ,"hawaiired","hawaii",59) addPedClothes (CJ,"afrogoatee","afro",32) addPedClothes (CJ,"worktrcamogrn","worktr",1) addPedClothes (CJ,"bask1prowht","bask1",17) addPedClothes (CJ,"neckhash","neck",4) addPedClothes (CJ,"watchsub1","watch",0) addPedClothes (CJ,"glasses04dark","glasses04",10) addPedClothes (CJ,"capzipup","caprimup",40) triggerServerEvent ("CJAPS",CJ,23,950) setTimer (setPedAnimation,500,1,CJ, "BEACH", "ParkSit_M_loop") setElementFrozen (CJ,true) end addEventHandler ("onClientResourceStart",root,CjCreating) Edited January 10, 2016 by Guest Link to comment
Revolt Posted January 9, 2016 Share Posted January 9, 2016 You are using the index instead of clothing type. addPedClothes (CJ,"hawaiired","hawaii",0) -- not 59 -- and so on... Link to comment
bebo1king Posted January 9, 2016 Author Share Posted January 9, 2016 You are using the index instead of clothing type. addPedClothes (CJ,"hawaiired","hawaii",0) -- not 59 -- and so on... i just saw it in the wiki thx the new proBlem now in trigger its not working -- Server function CJAPSs(client,health) setPedStat (source,client,health) end addEvent("CJAPS",true) addEventHandler("CJAPS",root,CJAPSs) Link to comment
Revolt Posted January 9, 2016 Share Posted January 9, 2016 -- CLIENT triggerServerEvent ("CJAPS",root,23,950) -- SERVER function CJAPSs(stat,value) setPedStat (client,stat,value) end addEvent("CJAPS",true) addEventHandler("CJAPS",root,CJAPSs) 'client' is a predefined variable. Maybe this would work. Link to comment
bebo1king Posted January 10, 2016 Author Share Posted January 10, 2016 -- CLIENT triggerServerEvent ("CJAPS",root,23,950) -- SERVER function CJAPSs(stat,value) setPedStat (client,stat,value) end addEvent("CJAPS",true) addEventHandler("CJAPS",root,CJAPSs) 'client' is a predefined variable. Maybe this would work. It did'nt work Link to comment
ViRuZGamiing Posted January 10, 2016 Share Posted January 10, 2016 triggerServerEvent("CJAPS", CJ, 24, 999) -- 24 is Max Health, 999 the value function CJAPSs(stat, value) setPedStat(source, stat, value) end addEvent("CJAPS",true) addEventHandler("CJAPS", getRootElement(), CJAPSs) Link to comment
bebo1king Posted January 10, 2016 Author Share Posted January 10, 2016 triggerServerEvent("CJAPS", CJ, 24, 999) -- 24 is Max Health, 999 the value function CJAPSs(stat, value) setPedStat(source, stat, value) end addEvent("CJAPS",true) addEventHandler("CJAPS", getRootElement(), CJAPSs) Still not working Link to comment
Castillo Posted January 10, 2016 Share Posted January 10, 2016 You can't change the stats of the ped for the simple reason that the ped is created client-side, so the server is not aware of it. Link to comment
bebo1king Posted January 10, 2016 Author Share Posted January 10, 2016 You can't change the stats of the ped for the simple reason that the ped is created client-side, so the server is not aware of it. If this what you mean : function CjCreating () CJ = createPed (0,352.5,-256.29998779297,715,90) setElementDimension (CJ , 200) addPedClothes (CJ,"tshirtmaddgrn","tshirt",0) addPedClothes (CJ,"afrogoatee","afro",1) addPedClothes (CJ,"worktrcamogrn","worktr",2) addPedClothes (CJ,"conv","convproblk",3) addPedClothes (CJ,"dogtag","neck",13) addPedClothes (CJ,"watchsub1","watch",14) addPedClothes (CJ,"glasses04dark","glasses04",15) setPedStat(CJ, 23, 999) setTimer (setPedAnimation,500,1,CJ, "BEACH", "ParkSit_M_loop") setElementFrozen (CJ,true) end addEventHandler ("onResourceStart",root,CjCreating) it didn't work too i put it in Server side now and it still not working + no bug in debug Link to comment
TAPL Posted January 10, 2016 Share Posted January 10, 2016 addEventHandler("onResourceStart", resourceRoot, function() CJ = createPed(0, 352.5, -256.3, 715, 90) setTimer(function() setElementDimension(CJ , 200) addPedClothes(CJ, "tshirtmaddgrn", "tshirt", 0) addPedClothes(CJ, "afrogoatee", "afro", 1) addPedClothes(CJ, "worktrcamogrn", "worktr", 2) addPedClothes(CJ, "conv", "convproblk", 3) addPedClothes(CJ, "dogtag", "neck", 13) addPedClothes(CJ, "watchsub1", "watch", 14) addPedClothes(CJ, "glasses04dark", "glasses04", 15) setPedStat(CJ, 23, 999) setPedAnimation(CJ, "BEACH", "ParkSit_M_loop") setElementFrozen(CJ, true) end, 500, 1) end) Link to comment
bebo1king Posted January 10, 2016 Author Share Posted January 10, 2016 addEventHandler("onResourceStart", resourceRoot, function() CJ = createPed(0, 352.5, -256.3, 715, 90) setTimer(function() setElementDimension(CJ , 200) addPedClothes(CJ, "tshirtmaddgrn", "tshirt", 0) addPedClothes(CJ, "afrogoatee", "afro", 1) addPedClothes(CJ, "worktrcamogrn", "worktr", 2) addPedClothes(CJ, "conv", "convproblk", 3) addPedClothes(CJ, "dogtag", "neck", 13) addPedClothes(CJ, "watchsub1", "watch", 14) addPedClothes(CJ, "glasses04dark", "glasses04", 15) setPedStat(CJ, 23, 999) setPedAnimation(CJ, "BEACH", "ParkSit_M_loop") setElementFrozen(CJ, true) end, 500, 1) end) It worked now thank you very much TAPL + Thank you all for your help Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now