Jump to content

toptional

Members
  • Posts

    493
  • Joined

Everything posted by toptional

  1. Here's the whole script It makes more sense lol function saveStats() account = getPlayerAccount(source) if not isGuestAccount (account ) then local Skin = getElementModel(source) setAccountData (account,"CMGRP.skin",tostring(Skin) ) local Health = getElementHealth ( source ) setAccountData ( account, "CMGRP.health", tostring(Health) ) local Money = getPlayerMoney ( source ) setAccountData ( account, "CMGRP.money", Money ) local Armour = getPedArmor ( source ) setAccountData ( account, "CMGRP.armour", tostring(Armour) ) local x,y,z = getElementPosition(source) setAccountData ( account, "CMGRP.Xpos", x ) setAccountData ( account, "CMGRP.Ypos", y ) setAccountData ( account, "CMGRP.Zpos", z ) end end addEventHandler("onPlayerLogout",getRootElement(),saveStats) addEventHandler("onPlayerQuit",getRootElement(),saveStats) function loadStats() account = getPlayerAccount(source) local skin = getAccountData (account,"CMGRP.skin" ) if skin then setTimer (setElementModel,source, skin) end local health = getAccountData ( account, "CMGRP.health" ) if health then setTimer (setElementHealth, 500, 1, source, health) end local money = getAccountData ( account, "CMGRP.money" ) if money then setPlayerMoney ( source, money ) end local armour = getAccountData ( account, "CMGRP.armour" ) if armour then setTimer (setPedArmor, 500, 1, source, armour) end x = getAccountData ( account, "CMGRP.Xpos" ) y = getAccountData ( account, "CMGRP.Ypos" ) z = getAccountData ( account, "CMGRP.Zpos" ) if x and y and z then spawnPlayer(source,x,y,z + 0.5,tonumber(skin),0) setCameraTarget(source) fadeCamera(source,true,2.5) else --spawnPlayer(source,0,0,999999) --setCameraTarget(source) --fadeCamera(source,true,2.5) end end addEventHandler("onPlayerLogin",getRootElement(),loadStats)
  2. Ok it works but the skin doesn't keep the same D: It has skin ID 0 all the time
  3. Got another issue with spawning the player and with his skin! It won't work function saveStats() account = getPlayerAccount(source) Skin = getElementModel(source) setAccountData (account,"CMG2.skin",tostring(Skin) ) local x,y,z = getElementPosition(source) setAccountData ( account, "CMG2.Xpos", x ) setAccountData ( account, "CMG2.Ypos", y ) setAccountData ( account, "CMG2.Zpos", z ) end addEventHandler("onPlayerLogout",getRootElement(),saveStats) addEventHandler("onPlayerQuit",getRootElement(),saveStats) function loadStats() account = getPlayerAccount(source) skin = getAccountData (account,"CMG2.skin" ) if skin then setTimer (setElementModel,source, skin) end x = getAccountData ( account, "CMG2.Xpos" ) y = getAccountData ( account, "CMG2.Ypos" ) z = getAccountData ( account, "CMG2.Zpos" ) if x and y and z then spawnPlayer(source,x,y,z + 0.5,tonumber(skin),0) setCameraTarget(source) fadeCamera(source,true,2.5) else --spawnPlayer(source,0,0,999999) --setCameraTarget(source) --fadeCamera(source,true,2.5) end end addEventHandler("onPlayerLogin",getRootElement(),loadStats)
  4. skin is defined earlier in the script would this be fine for the x y z? x,y,z = getElementPosition x = getAccountData ( account, "CMG2.Xpos" ) y = getAccountData ( account, "CMG2.Ypos" ) z = getAccountData ( account, "CMG2.Zpos" )
  5. Why won't this work D: no debug errors function saveStats() account = getPlayerAccount(source) setAccountData ( account, "CMG2.Xpos", x ) setAccountData ( account, "CMG2.Ypos", y ) setAccountData ( account, "CMG2.Zpos", z ) end addEventHandler("onPlayerLogout",getRootElement(),saveStats) addEventHandler("onPlayerQuit",getRootElement(),saveStats) function loadStats() account = getPlayerAccount(source) x = getAccountData ( account, "CMG2.Xpos" ) y = getAccountData ( account, "CMG2.Ypos" ) z = getAccountData ( account, "CMG2.Zpos" ) if x and y and z then spawnPlayer(source,x,y,z + 0.5,0,skin) setCameraTarget(source) fadeCamera(source,true,2.5) else spawnPlayer(source,0,0,999999) end end addEventHandler("onPlayerLogin",getRootElement(),loadStats) (I chopped this off my larger script script becuase everything else worked like the health and ammo!
  6. toptional

    CMG2 Trailer!

    I present the official Hope you enjoyed it Full topic of CMG2 is over here: viewtopic.php?f=115&t=56545
  7. Your probably entering the wrong IP, for you to join enter your local address, for others enter your PUBLIC address.
  8. Do not buy from this. This is just terrible it is run by an arabic, terrible english speaker probably trying to steal scripts and scam people.
  9. This is constructive criticism and you must be able to accept it, In all the scripts i see you have done or are developing, they have been made before in other servers so if your going to make an RP server you won't get far by making something that as already been made a thousand times.
  10. Doesn't look a Original, just another RP server.
  11. I suggest FibreOptic, i am current hosting with them, they really cheap and reliable! add them on skype: fibre.optic you get a 75 slot for like 6-7 euro's!
  12. This is just at a laugh :facepalm:
  13. Ok it seems to work but i hope it's all local!
  14. But i don't want the vehicle being spawned for everyone only the person who called the function
  15. Oh btw! another slight issue with destroyElement. it doesn't destroy the cars addEvent ( "spawnBaggage", true) addEventHandler ("spawnBaggage", root, function () local baggage = createVehicle ( 485, 1713.62378, 1458.48633, 10.73280, 0, 0,-3 ) warpPedIntoVehicle( source, baggage ) outputChatBox ("Please make your way to Las Venturas Airport! A Blip has been marked on you map.", source,255,255,0, false) fixVehicle ( baggage ) end ) addEvent ( "spawnFaggio", true) addEventHandler ("spawnFaggio", root, function () local faggio = createVehicle ( 462, 1713.62378, 1458.48633, 10.73280, 0, 0,-3 ) warpPedIntoVehicle( source, faggio ) outputChatBox ("Please make your way to Las Venturas Airport! A Blip has been marked on you map, choose which terminal to spawn your plane.", source,255,255,0, false) fixVehicle ( faggio ) end ) addEvent ( "spawnTug", true) addEventHandler ("spawnTug", root, function () local tug = createVehicle ( 583, 1713.62378, 1458.48633, 10.73280, 0, 0,-3 ) warpPedIntoVehicle( source, tug ) outputChatBox ("Please make your way to Las Venturas Airport! A Blip has been marked on you map, choose which terminal to spawn your plane.", source,255,255,0, false) fixVehicle ( tug ) end ) addEvent ( "spawnDodo1", true) addEventHandler ("spawnDodo1", root, function () local dodo1 = createVehicle ( 593, 1277.43933, 1361.18616, 10.81298, 0, 0,-90) warpPedIntoVehicle( source, dodo1 ) outputChatBox ("Please make your way to the terminal your passasengers await you.", source,255,255,0, false) fixVehicle ( dodo1 ) destroyElement(faggio) destroyElement(tug) destroyElement(baggage) end ) addEvent ( "spawnDodo2", true) addEventHandler ("spawnDodo2", root, function () local dodo2 = createVehicle ( 593, 1278.48193, 1324.14075, 10.82031, 0, 0,-90) warpPedIntoVehicle( source, dodo2 ) outputChatBox ("Please make your way to the terminal your passasengers await you.", source,24,116,205, false) fixVehicle ( dodo2 ) destroyElement(faggio) destroyElement(tug) destroyElement(baggage) end )
  16. Perfect it works! Thanks for your help
  17. Note - seems like when i type faggio it turns into a ":O" I think a Forum bug there... as faggio is not a swearword :facepalm:
  18. Im using destroyElement alot in this script and i keep getting errors on all the lines saying bad element pointer and bad arguments? It's weird take a look. Note this is just some of the code, all you will need i think. addEventHandler ( 'onClientGUIClick', ButtonBaggage, function ( ) triggerServerEvent ('spawnBaggage', localPlayer ) guiSetVisible ( Window1, false ) showCursor ( false ) destroyElement ( MissionMarker ) local dodoMarker1 = createMarker (1286.41077, 1345.46094, 10, "cylinder", 2, 255, 255, 0, 255 ) blip1 = createBlipAttachedTo ( dodoMarker1, 41 ) local dodoMarker2 = createMarker (1285.84778, 1309.42847, 10, "cylinder", 2, 255, 255, 0, 255 ) blip2 = createBlipAttachedTo ( dodoMarker2, 41 ) addEventHandler('onClientMarkerHit',dodoMarker1,showGui2,false) addEventHandler('onClientMarkerHit',dodoMarker2,showGui3,false) end ) addEventHandler ( 'onClientGUIClick', ButtonFaggio, function ( ) triggerServerEvent ('spawnFaggio', localPlayer ) guiSetVisible ( Window1, false ) showCursor ( false ) destroyElement ( MissionMarker ) local dodoMarker1 = createMarker (1286.41077, 1345.46094, 10, "cylinder", 2, 255, 255, 0, 255 ) blip1 = createBlipAttachedTo ( dodoMarker1, 41 ) local dodoMarker2 = createMarker (1285.84778, 1309.42847, 10, "cylinder", 2, 255, 255, 0, 255 ) blip2 = createBlipAttachedTo ( dodoMarker2, 41 ) addEventHandler('onClientMarkerHit',dodoMarker1,showGui2,false) addEventHandler('onClientMarkerHit',dodoMarker2,showGui3,false) end ) addEventHandler ( 'onClientGUIClick', ButtonTug, function ( ) triggerServerEvent ('spawnTug', localPlayer ) guiSetVisible ( Window1, false ) showCursor ( false ) destroyElement ( MissionMarker ) local dodoMarker1 = createMarker (1286.41077, 1345.46094, 10, "cylinder", 2, 255, 255, 0, 255 ) blip1 = createBlipAttachedTo ( dodoMarker1, 41 ) local dodoMarker2 = createMarker (1285.84778, 1309.42847, 10, "cylinder", 2, 255, 255, 0, 255 ) blip2 = createBlipAttachedTo ( dodoMarker2, 41 ) addEventHandler('onClientMarkerHit',dodoMarker1,showGui2,false) addEventHandler('onClientMarkerHit',dodoMarker2,showGui3,false) end ) addEventHandler('onClientGUIClick',Button2, function () triggerServerEvent('spawnDodo1',localPlayer ) destroyElement(dodoMarker1) destroyElement(dodoMarker2) destroyElement(blip1) destroyElement(blip2) guiSetVisible(Window2, false) showCursor(false) end ) addEventHandler('onClientGUIClick',Button3, function () triggerServerEvent('spawnDodo2',localPlayer ) destroyElement(dodoMarker1) destroyElement(dodoMarker2) destroyElement(blip1) destroyElement(blip2) guiSetVisible(Window3, false) showCursor(false) end )
  19. I wish CLEO mods, and custom animations were added to MTA It would make servers on a completely different level!
  20. I figured it out! Thanks csmit
  21. toptional

    Green Candy

    Great job! Glad to see some people contributing! Hope you guys can work with the dev team to put release this!
×
×
  • Create New...