xeon17 Posted December 29, 2013 Share Posted December 29, 2013 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
The Killer Posted December 29, 2013 Share Posted December 29, 2013 You can use setPedStat Link to comment
xeon17 Posted December 29, 2013 Author Share Posted December 29, 2013 setPedStat(thePlayer 26, 999) setPedStat(thePlayer, 32, 999) no work can someone help me? Link to comment
Castillo Posted December 29, 2013 Share Posted December 29, 2013 Change 'thePlayer' with 'source'. Link to comment
xeon17 Posted December 29, 2013 Author Share Posted December 29, 2013 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
Castillo Posted December 29, 2013 Share Posted December 29, 2013 Yes, that should do. Link to comment
xeon17 Posted December 29, 2013 Author Share Posted December 29, 2013 No work when the player spawn , he still have only 1 sawed off and tec9 i changed the pedskill to 1000 after to 9999 , but nothing happen. he still have 1 sawn off & tec9 . I restarted script too nothing changed , no bug in debug. Link to comment
Castillo Posted December 29, 2013 Share Posted December 29, 2013 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
xeon17 Posted December 29, 2013 Author Share Posted December 29, 2013 I'm noob scripter , i started creating scripts before 10-15 days The script work , thank you much Solidsnake Link to comment
Castillo Posted December 29, 2013 Share Posted December 29, 2013 69: WEAPONTYPE_PISTOL_SKILL70: 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
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