Jump to content

Respawn


Try

Recommended Posts

Posted

Hello Again!

I need one Help with this code:

addEventHandler("onPlayerWasted", getRootElement(), function () 
local x, y, z = getElementPosition(source) 
spawnPlayer ( source, x, y, z, 0, math.random(0, 200) ) 
end 
) 

It is spawming real fast

I add one setTimer but don't go

Who can help me

;)
Posted

If I right understand you wanna add timer but it doesn't work... Try use

  
addEventHandler("onPlayerWasted", getRootElement(), function () 
       local x, y, z = getElementPosition(source) 
       local skin = math.random(0, 200) 
       setTimer(spawnPlayer, 5000, 1, source, x, y, z, 0, skin) 
end 
) 
  

I am not great scripter so if not work set line "setTimer(spawnPlayer, 5000, 1, source, x, y, z, 0, skin)" to

setTimer(spawnPlayer, 5000, 1, source, x, y, z, 0, tonumber(skin)) 

Posted

I think would be easier to make a table with the valid skin ids and then randomize from there ;)

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted (edited)

Yeah I think too and I make for you a script which write me all valid Skin:

Code EDITED !

invalidSkin={1,2,3,4,5,6,8,42,65,74,86,119,149,208,239,265,266,267,268,269,270,271,272,273} 
  
function isAValidSkin( skinID ) 
    for k, i in ipairs( invalidSkin ) do 
        if ( tonumber( skinID ) == tonumber( i ) ) then 
            return false 
        end 
    end 
    return true 
end 
  
function writeTable( txt ) 
    local savefile = fileOpen( "table.txt" ) 
    if ( savefile ) then 
        fileSetPos( savefile, fileGetSize( savefile ) ) 
        fileWrite( savefile, txt.."," ) 
    end 
    fileClose( savefile ) 
end 
  
function createTable( thePlayer, commandName ) 
    for k=0, 273 do 
        if ( isAValidSkin( k ) )then 
            writeTable( k ) 
        end 
    end 
end 
addCommandHandler("skinTable", createTable, false, false )) 

I copy-paste all the numbers in this table:

EDIT: Now it's the real valid skins table !

validSkin={0,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,66,67,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,84,85,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264} 

Enjoy with this big table ! :mrgreen:

Edited by Guest

The rEvolution is coming ...

Posted

It seems that your code is incorrect you put:

invalidSkin = 

But you put in your check function:

if ( tonumber( skinID ) == tonumber( i ) ) then 
      return true 
end 

I think you want to put:

if ( tonumber( skinID ) == tonumber( i ) ) then 
      return false 
end 

:P

Welcome to the beginning...

Posted

Ok Thanks I go test all u give for me ;D

And one think for Solidsnake14:

Hello you remeber my ped topic? u said for no one give me the code :D now i don't asked for code i only need a help with setTimer and look the other topic they come and post and now u cant say i asked for code ;D

Cya!

______________

Kisses babys (im a girl)

;)
Posted

I don't get what do you mean, explain yourself.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted

I said that I edited my first post because I made an error so in the table I get the valid and the invalid skins

The rEvolution is coming ...

Posted

Not you, lol.

I meant this:

"And one thing for Solidsnake14:

Hello you remeber my ped topic? u said for no one give me the code :D now i don't asked for code i only need a help with setTimer and look the other topic they come and post and now u cant say i asked for code ;D

Cya!"

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ok

its cuz in other topic you said for no one give the code cuz i asked and now i don't asked and the peoples give by theyselves

idk if i write correct or no ;D but don't worry about what i said ;D

Kisses

;)
Posted

I don't get a f*** of that o,O.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i think it goes something like this:

i asked in nother topic if you give me a working script and you said no, in this topic i did not asked for nothing, but people gave me a script

i don't care if you dont understand me, and you shuld not care what i said

;)

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