Greenie0101 Posted August 8, 2012 Share Posted August 8, 2012 hi this is part of a gamemode script and i want to stop me from losing weapons on my death. i get an error saying bad argument @ giveWeapon function respawn() if getPlayerTeam(source) == LV then spawnPlayer(source, 2589, 2790, 11, 90, 0) end if getPlayerTeam(source) == LS then spawnPlayer(source, 1948, -2219, 15, 0, 0) end if getPlayerTeam(source) == SF then spawnPlayer(source, 2589, 2790, 11, 270, 0) end if getPlayerTeam(source) == false then spawnPlayer(source, 0, 0, 3, 270, 0) end setCameraTarget ( source, source ) fadeCamera(source, true, 5) wep0 = getPedWeapon ( source, 0 ) amo0 = getPedTotalAmmo ( source, 0) wep1 = getPedWeapon ( source, 1 ) amo1 = getPedTotalAmmo ( source, 1) wep2 = getPedWeapon ( source, 2 ) amo2 = getPedTotalAmmo ( source, 2) wep3 = getPedWeapon ( source, 3 ) amo3 = getPedTotalAmmo ( source, 3) wep4 = getPedWeapon ( source, 4 ) amo4 = getPedTotalAmmo ( source, 4) wep5 = getPedWeapon ( source, 5 ) amo5 = getPedTotalAmmo ( source, 5) wep6 = getPedWeapon ( source, 6 ) amo6 = getPedTotalAmmo ( source, 6) wep7 = getPedWeapon ( source, 7 ) amo7 = getPedTotalAmmo ( source, 7) wep8 = getPedWeapon ( source, 8 ) amo8 = getPedTotalAmmo ( source, -- s8) --> wep9 = getPedWeapon ( source, 9 ) amo9 = getPedTotalAmmo ( source, 9) wep10 = getPedWeapon ( source, 10 ) amo10 = getPedTotalAmmo ( source, 10) wep11 = getPedWeapon ( source, 11 ) amo11 = getPedTotalAmmo ( source, 11) end addEventHandler ( "onPlayerWasted", getRootElement(), respawn ) function spawnweps() giveWeapon ( source, wep0, amo0 ) giveWeapon ( source, wep1, amo1 ) giveWeapon ( source, wep2, amo2 ) giveWeapon ( source, wep3, amo3 ) giveWeapon ( source, wep4, amo4 ) giveWeapon ( source, wep5, amo5 ) giveWeapon ( source, wep6, amo6 ) giveWeapon ( source, wep7, amo7 ) giveWeapon ( source, wep8, amo8 ) giveWeapon ( source, wep9, amo9 ) giveWeapon ( source, wep10, amo10 ) giveWeapon ( source, wep11, amo11 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), spawnweps ) Link to comment
Anderl Posted August 8, 2012 Share Posted August 8, 2012 (edited) First time it will give error of course as the variables aren't defined. You should re-write that in other way. Edited August 8, 2012 by Guest Link to comment
Greenie0101 Posted August 8, 2012 Author Share Posted August 8, 2012 First time it will give error, of course as the variables aren't defined. You should re-write that in other way. no its a wierd one. I usually keep them on the first death, then lose on second death? 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