TogglePlayerControllabe Alternative
#1

Im making a death system, So when player dies he will be set freeze by setting TogglePlayerControllabe to false or 0. But what TogglePlayerControllable does is, It make player invulnerable (his hp doesnt decrease even if we shoot). I want to make it so that he cant move and also he can be shot down
Reply
#2

There are many altirnativa ways but their cheesy and eating resources, such as setting the position constantly under OnPlayerUpdate.
Reply
#3

try this
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        TogglePlayerControllable(playerid,0);
        SetPlayerHealth(playerid, 0.1);
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/accept death", cmdtext, true, 10) == 0)
    {
        TogglePlayerControllable(playerid,1);
        SetPlayerHealth(playerid, 100);
        SetPlayerPos(playerid, 0, 0, 0);
        SendClientMessage(playerid, 0x667788,"haha!the medic's throw you out of the ambolance!");
        return 1;
    }
    return 0;
}
Reply
#4

Lmao xkril ! Once look what i asked. @Admantis really? But some servers have it, They can shoot dead players! So i was wondering if there was an easy way to do without lag
Reply
#5

Got an idea can it be done like returning the player to the death positions when onplayerkeystatechange?
Reply
#6

Please help me! this is the main part of the whole system
Reply
#7

Thanks xkirill
Reply
#8

Quote:
Originally Posted by Razvan_Cosmyn
Посмотреть сообщение
Thanks xkirill
xkirills code won't work. That guy needs to learn how to script >.<
Reply
#9

Use an animation like an injured one and make the player impossible to cancel it. I'm not sure if he can die now but you can try.
Reply
#10

I solved it, I just made a variable if the player is dead and when he is dead i made him to return to the dead place co-ordinates under onplayerkeystatechange
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)