Jump to content

Why not work?


Tomek123

Recommended Posts

  • Replies 104
  • Created
  • Last Reply

Top Posters In This Topic

Ah not work i try :cry:

-- this function is called whenever someone types 'createmarker' in the console: 
function consoleCreateMarker ( thePlayer, commandName ) 
   if ( thePlayer ) then 
      local x, y, z = getElementPosition ( thePlayer ) -- get the player's position 
      -- create a cylindrical marker next to the player: 
      local theMarker = createMarker ( -376.8867 + 2, 2251.6767 + 2, 42.4843, "cylinder", 1.5, 255, 255, 0, 170 ) 
      if ( theMarker ) then -- check if the marker was created successfully 
         outputConsole ( "Marker created successfully", thePlayer ) 
      else 
         outputConsole ( "Failed to create marker", thePlayer ) 
      end 
   end 
end 
addCommandHandler ( "createmarker", consoleCreateMarker ) 

why not work?

Link to comment

i try with this /createmarker but not work :(

BTW. what is here wrong i try create Zombie kills saver but this script not serve kills :cry:

function onPlayerQuit ( ) 
      -- when a player leaves, store his current money amount in his account data 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playermoney = getPlayerMoney ( source ) 
            setAccountData ( playeraccount, "play.kill", playeZombieWasted ) 
      end 
end 
  
function onPlayerJoin ( ) 
      -- when a player joins, retrieve his money amount from his account data and set it 
      local playerZombieWasted = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playeZombieWasted = getAccountData ( playeraccount, "play.kill" ) 
            -- make sure there was actually a value saved under this key (check if playermoney is not false). 
            -- this will for example not be the case when a player plays the gametype for the first time 
            if ( playerZombieWasted ) then 
                  setPlayerZombieWasted ( source, playerZombieWasted ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) 

Link to comment

WTF IS THAT? it's using functions that don't even exist, this makes completely no sense (no offense),

  
function onPlayerQuit ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            kills = getElementData(source,"Zombie kills") 
            setAccountData ( playeraccount, "play.kill", kills ) 
      end 
end 
  
function onPlayerLogin ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local kills = getAccountData ( playeraccount, "play.kill" ) 
            if ( kills ) then 
            setElementData ( source, "Zombie kills", kills ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) 

try that.

Link to comment
function onPlayerQuit ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            clothes = getPedClothes" class="kw2">getPedClothes(source,"PlayerClothes") 
            setAccountData ( playeraccount, "play.clothes", playerclothes ) 
      end 
end 
  
function onPlayerJoin ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerclothes = getAccountData ( playeraccount, "play.clothes" ) 
            if ( playerclothes ) then 
            setPedClothes ( source, "PlayerClothes", clothes ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) 

I start debugscript 3 and here not have warnings what is wrong pls help!

Link to comment
function onPlayerQuit ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            clothes = getPedClothes" class="kw2">getPedClothes(source,"PlayerClothes") 
            setAccountData ( playeraccount, "play.clothes", playerclothes ) 
      end 
end 
  
function onPlayerJoin ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerclothes = getAccountData ( playeraccount, "play.clothes" ) 
            if ( playerclothes ) then 
            setPedClothes ( source, "PlayerClothes", clothes ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) 

I start debugscript 3 and here not have warnings what is wrong pls help!

1. getPedClothes retrieves 2 strings (clothes texture, clothes model) and also you used the wrong arguments, can't you read Wiki?

It clearly says it needs ped element (which you put correctly) and integer (and you have put a string in there).

2. setPedClothes doesn't exist, you must use addPedClothes.

Read a little!

https://wiki.multitheftauto.com/wiki/GetPedClothes

https://wiki.multitheftauto.com/wiki/AddPedClothes

Link to comment
function onPlayerQuit ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            clothes = getPedClothes" class="kw2">getPedClothes(source,"PlayerClothes") 
            setAccountData ( playeraccount, "play.clothes", playerclothes ) 
      end 
end 
  
function onPlayerJoin ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerclothes = getAccountData ( playeraccount, "play.clothes" ) 
            if ( playerclothes ) then 
            setPedClothes ( source, "PlayerClothes", clothes ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) 

I start debugscript 3 and here not have warnings what is wrong pls help!

1. getPedClothes retrieves 2 strings (clothes texture, clothes model) and also you used the wrong arguments, can't you read Wiki?

It clearly says it needs ped element (which you put correctly) and integer (and you have put a string in there).

2. setPedClothes doesn't exist, you must use addPedClothes.

Read a little!

https://wiki.multitheftauto.com/wiki/GetPedClothes

https://wiki.multitheftauto.com/wiki/AddPedClothes

I try with this and console say me "Bad argument @ "addPedClothes"

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