Jump to content

Questions


xeon17

Recommended Posts

Hello , i crated a script who let players get money & weapons onSpawn but how i can change the Weapons skills at spawn? i wanna set all weapon skills to 1000 when player spawn.

The Script :

function onSpawn ( ) 
giveWeapon ( source, 24, 300 ) 
giveWeapon ( source, 26, 300 ) 
giveWeapon ( source, 32, 300 ) 
giveWeapon ( source, 31, 300 ) 
giveWeapon ( source, 46, 1 ) 
giveWeapon ( source, 24, 300 ) 
giveWeapon ( source, 34, 20 ) 
givePlayerMoney ( source, 2500 ) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) 

And what functions i need to use to crate a Godmode script , when a admin write /godmode then nobody can kill him and over his head is a picture ''GODMODE'' .

Thanks. :)

Link to comment

This will work ?

function onSpawn ( ) 
giveWeapon ( source, 24, 300 ) 
setPedStat(source, 26, 999) 
setPedStat(source, 32, 999) 
giveWeapon ( source, 26, 300 ) 
giveWeapon ( source, 32, 300 ) 
giveWeapon ( source, 31, 300 ) 
giveWeapon ( source, 46, 1 ) 
giveWeapon ( source, 24, 300 ) 
giveWeapon ( source, 34, 20 ) 
givePlayerMoney ( source, 2500 ) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) 

And i thinked a little about my script Godmode , how i can set that only ''Admin'' can use the command /godmode

Link to comment

The problem is that you used weapon IDs as stat IDs, but that's wrong.

function onSpawn ( ) 
    giveWeapon ( source, 24, 300 ) 
    setPedStat ( source, 73, 1000 ) 
    setPedStat ( source, 75, 1000 ) 
    giveWeapon ( source, 26, 300 ) 
    giveWeapon ( source, 32, 300 ) 
    giveWeapon ( source, 31, 300 ) 
    giveWeapon ( source, 46, 1 ) 
    giveWeapon ( source, 24, 300 ) 
    giveWeapon ( source, 34, 20 ) 
    givePlayerMoney ( source, 2500 ) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) 

Link to comment
69: WEAPONTYPE_PISTOL_SKILL

70: WEAPONTYPE_PISTOL_SILENCED_SKILL

71: WEAPONTYPE_DESERT_EAGLE_SKILL

72: WEAPONTYPE_SHOTGUN_SKILL

73: WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL

74: WEAPONTYPE_SPAS12_SHOTGUN_SKILL

75: WEAPONTYPE_MICRO_UZI_SKILL

76: WEAPONTYPE_MP5_SKILL

77: WEAPONTYPE_AK47_SKILL

78: WEAPONTYPE_M4_SKILL

79: WEAPONTYPE_SNIPERRIFLE_SKILL

These are all the weapon skill IDs.

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