Jump to content

2 Questions


Ralf122

Recommended Posts

Posted

I wanted to make peds in my own server, so i went to coommunity and searched for a good script to make peds, but these script didn't work and some other script were for peds who are walking, and i don't need that. I only want to make Peds who're doing nothing. so i thought maybe some of you does have a easy script to make peds.

Second question.

All the cars dissapear after a little time, and i don't want it so i tried to change it in freeroam resource. but i can't stop it. so is there a script for this problem?

Sorry for my bad english!

Posted

Im sure this works, but im new to scripting and not totally sure, I ussually look it up before posting, but here it is off the top of my head...

function createPed() 
createPed(123,3432,7989,8965, 190) 
end 
addEventHandler("onResourceStart", getElementRoot(), createPed) 

Lol... sorry if thats wrong, im not sure.

Posted

this should do what you want

function createPeds ( player, cmd, skin, weaponID, ammo ) 
local x, y, z = getElementPosition( player ) 
ped = createPed(skin, x, y, z) 
giveWeapon ( ped, weaponID, ammo, true ) 
end 
addCommandHandler ( "ped", createPeds ) 

Posted (edited)

COLOR YELLOW is server-side

COLOR RED is client-side

COLOR BLUE is both

Edit:

Just look it in wiki mtasa.

Edited by Guest
Posted

clientside:

    function createPeds ( cmd, skin, weaponID, ammo ) 
    local x, y, z = getElementPosition( getLocalPlayer() ) 
    ped = createPed(tonumber(skin), x, y, z) 
    giveWeapon ( ped, tonumber(weaponID), tonumber(ammo), true ) 
    end 
    addCommandHandler ( "ped", createPeds ) 

Posted

function createPeds ( player, cmd, 165, 31, 0 ) 
local 1710.4483642578, -2597.6245117188, 13.546875 = getElementPosition( player ) 
ped = createPed(skin 165, 1710.4483642578, -2597.6245117188, 13.546875) 
giveWeapon ( ped, 31, 0, true ) 
end 
addCommandHandler ( "ped", createPeds ) 

did i do something wrong?

Posted
function createPeds ( player, cmd, 165, 31, 0 ) 
local 1710.4483642578, -2597.6245117188, 13.546875 = getElementPosition( player ) 
ped = createPed(skin 165, 1710.4483642578, -2597.6245117188, 13.546875) 
giveWeapon ( ped, 31, 0, true ) 
end 
addCommandHandler ( "ped", createPeds ) 

did i do something wrong?

wtf is this?

just use this

function createPeds ( player, cmd, skin, weaponID, ammo ) 
local x, y, z = getElementPosition( player ) 
ped = createPed(skin, x, y, z) 
giveWeapon ( ped, weaponID, ammo, true ) 
end 
addCommandHandler ( "ped", createPeds ) 

to use the command type in F8: ped 165 31 9999

you will see a ped near you with skin 165 and with weapon m4 and with ammo 9999

Posted

i just want a ped on one place with a weapon. i doesn't have to do something. a friend of mine has had a serve,. and started a script. when the script started two peds with a weapon appeared. he didn't wrote something in F8. i just wanted the same.

Posted
function createPeds() 
ped = createPed(165, 1710.4483642578, -2597.6245117188, 13.546875) 
giveWeapon ( ped, 31, 9999, true ) 
end 
addEventHandler("onResourceStart", getElementRoot(), createPeds) 

Posted (edited)
function createPeds() 
ped = createPed(165, 1710.4483642578, -2597.6245117188, 13.546875) 
giveWeapon ( ped, 31, 9999, true ) 
end 
addEventHandler("onResourceStart",resourceRoot, createPeds) 

EDIT: I fixed the code now should work

Edited by Guest

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