21.10.2014, 22:45
Hello.
I'm kind of new at Pawno scripting, but i've done this and that @lua script and C++ before.
So currently i'm working on a samp RP server gamemode, doing afterlife system, but i have a problem which i can't fix.
I took this script as the base. Thank you Admantis for ur work. https://sampforum.blast.hk/showthread.php?tid=205223
So the script all in all works fine, it does what it was supposed to do. When the player dies, after writing in /acceptdeath i get sent to the local hospital.
The problem is that, after dieing it used to open up a skin selection menu with CJ. Did abit of research and found out that i have to add SpawnPlayer in OnPlayerRequestClass. It worked, i didnt get the class seletion menu anymore, but the problem was it teleported the character to its spawn position, obviously coz thats what SpawnPlayer is supposed to do, and the deathcam was still at the place where it died. I can't seem to find a way how to fix this. The character should be left dead at the place where it died instead of teleporting it away to its spawn position. I tried to add "SetPlayerPos(...Death positon cordinates); in the OnPlayerRequest but it did not work like that.
That was the first thing, secound problem is the camera. After using the command acceptdeath it brings me to afterlife screen, where it makes a countdown. The camera was supposed to show the entrance of Los Santos hospital but instead its somewhere up in the sky. I tought its because i didnt define in which virtual world the camera is, but even after i defined it, its still not working.
Due to my bad English, i made a small video that shows whats going on.
https://www.youtube.com/watch?v=V1v9cIfqBoY
Heres my script.
http://pastebin.com/VJ8RP1Pg
I'm kind of new at Pawno scripting, but i've done this and that @lua script and C++ before.
So currently i'm working on a samp RP server gamemode, doing afterlife system, but i have a problem which i can't fix.
I took this script as the base. Thank you Admantis for ur work. https://sampforum.blast.hk/showthread.php?tid=205223
So the script all in all works fine, it does what it was supposed to do. When the player dies, after writing in /acceptdeath i get sent to the local hospital.
The problem is that, after dieing it used to open up a skin selection menu with CJ. Did abit of research and found out that i have to add SpawnPlayer in OnPlayerRequestClass. It worked, i didnt get the class seletion menu anymore, but the problem was it teleported the character to its spawn position, obviously coz thats what SpawnPlayer is supposed to do, and the deathcam was still at the place where it died. I can't seem to find a way how to fix this. The character should be left dead at the place where it died instead of teleporting it away to its spawn position. I tried to add "SetPlayerPos(...Death positon cordinates); in the OnPlayerRequest but it did not work like that.
That was the first thing, secound problem is the camera. After using the command acceptdeath it brings me to afterlife screen, where it makes a countdown. The camera was supposed to show the entrance of Los Santos hospital but instead its somewhere up in the sky. I tought its because i didnt define in which virtual world the camera is, but even after i defined it, its still not working.
Due to my bad English, i made a small video that shows whats going on.
https://www.youtube.com/watch?v=V1v9cIfqBoY
Heres my script.
http://pastebin.com/VJ8RP1Pg