Jump to content

[HELP] setPedStat


India

Recommended Posts

Ped stats changing by command, i want it when resource started, how can i? can anyone help

 

commandName = "defaultstats"

addCommandHandler (commandName,

 function(sot)
  setPedStat (sot, 22, 0)
  setPedStat (sot, 23, 0)
  outputChatBox("Stats Changed To Default!", sot, 255, 0, 0)
 end
)

 

Link to post

Hello,

I assume that this code is meant to be server-sided then this should do the work:

function onStartSetStats()
	for i, player in pairs (getElementsByType("player")) do
		setPedStat (player, 22, 0)
		setPedStat (player, 23, 0)
		outputChatBox("Stats Changed To Default!", player, 255, 0, 0)
	end
end
addEventHandler("onResourceStart",resourceRoot,onStartSetStats)

 

  • Thanks 1
Link to post
1 hour ago, SpecT said:

Hello,

I assume that this code is meant to be server-sided then this should do the work:


function onStartSetStats()
	for i, player in pairs (getElementsByType("player")) do
		setPedStat (player, 22, 0)
		setPedStat (player, 23, 0)
		outputChatBox("Stats Changed To Default!", player, 255, 0, 0)
	end
end
addEventHandler("onResourceStart",resourceRoot,onStartSetStats)

 

Its work. Thank you so much for your help and for your time 💙💫

  • Like 1
Link to post

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