TogglePlayerControllable - Death System
#1

Hello, i've one problem with TogglePlayerControllable because i've set this params for freeze the player when he is dead.
How can i resolve this?
This is my script, thanks:
PHP код:
SendClientMessage(playerid,COLOR_LIGHTRED,"Sei stato ferito. Perderai sempre piщ HP almeno che un medico non arrivi.");
                     
SendClientMessage(playerid,COLOR_LIGHTRED,"Puoi usare /accettamorte tra 1 minuto. Per fermare l'attesa.");
                    
TogglePlayerControllable(playerid,0);
                    
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
                    
SetPlayerHealth(playerid,50);
                    
death_hploss[playerid] = 60;
                    
death_cooldown[playerid] = 60
Reply
#2

Код:
 TogglePlayerControllable(playerid,1);
0 - Player cant move or move mouse anything
1 - Player can run, move his/her mouse.
Reply
#3

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Код:
 TogglePlayerControllable(playerid,1);
0 - Player cant move or move mouse anything
1 - Player can run, move his/her mouse.
Yes, i know this but the problem is when any player try to kill, he is invunerable!
Does not receive damage, and i've try to leave TogglePlayerControllable and the player can move and escape.
Reply
#4

What actually happens, you don't get froze?
Reply
#5

Because,

You already setted victims health.

Код:
SetPlayerHealth(playerid,50);
Try to add

Код:
 TogglePlayerControllable(playerid,0);*
At last.

*Where you are using this code btw? Because here you used playerid which means the killer get frozed and his health setted tp 50.

Show where you using.
Reply
#6

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
What actually happens, you don't get froze?
He is froze but when i try to kill he don't lose HP.
Reply
#7

Quote:
Originally Posted by Carxi
Посмотреть сообщение
He is froze but when i try to kill he don't lose HP.
Add

Код:
TogglePlayerControllable(playerid,0);
At last of all the codes.
Reply
#8

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Add

Код:
TogglePlayerControllable(playerid,0);
At last of all the codes.
Okay, when i kill the player whit my hands, he lose hp.
But when i kill with the guns he don't lose hp.
Reply
#9

of course it's bug in your server not on the code.
Reply
#10

Quote:
Originally Posted by AhmedMohamed
Посмотреть сообщение
of course it's bug in your server not on the code.
Is possible in OnPlayerKeyStateChange?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)