Problems with my spec sistem
#1

Guys i got a problem with my spec sistem,its that when i /spec some one its everything ok,but when i do /specoff im spawned in hospitaland it sais i need to rest 30 sec.This thing happend a player die is spawned in hospital too,but i want to know why its happend when i /specoff too.The admin sistem its great but it have this bug wich its very annoing,and the admin sistem its scripted in GM so its not a FS,plese can you tell me how to fix it?TX you very much guys!
Reply
#2

I never made a spec sistem, but probably, when you do /spec you have to SetSpawnInfo
https://sampwiki.blast.hk/wiki/SetSpawnInfo
because at /spec make it setspawninfo, saving your current coordnates, and at /specoff when player spawns it probably will spawn back where it was, or maybe in your callbac OnPlayerSpawn you have somethin buggin it? dunno, check the admin filterscript's spec's and ul see
Reply
#3

How does your /specoff cmd look like?
Reply
#4

i know that on the other spec sistems,after you /specoff you are spawned back where you was before you spec that player,but im spawned on hospital,its like i die after i specthis is what i want to fix,i want after i /specoff to be spawned back where i was before /specplayer
Reply
#5

OnPlayerSpawn gets executed when your state changes from spectating back to "onfoot".

So you gotta define a value that changes if a player is spectating, save his previous coordinates and return him to them in OnPlayerSpawn if he uses /specoff.
Reply
#6

ok now tell me how to do it plese?
Reply
#7

Create as much new globals as you need (depending on whether you use virtual worlds, interiors etc.).

When someone does /spec you save the coordinations of the player`s position (+virtual world & interior if you have that) in those globals and set a global boolean to true.

In OnPlayerSpawn you include an if-statement that sets the player position to these values if your boolean is true.
Reply
#8

ok can you give me the code?
Reply
#9

I just told you how to do it
Reply
#10

Quote:
Originally Posted by twinki
ok can you give me the code?
This is to "help" you with coding, now "give" you code.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)