Spec problem
#7

Quote:
Originally Posted by lulo356
Посмотреть сообщение
Okay well, the real problem is, you see the money armour name and health from ID 0 How to fix that

pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
        {
            new id, string[235], Float:H, Float:A;
            GetPlayerHealth(id, H); GetPlayerArmour(id, A);
            format(string,sizeof(string),"Health: %0.1f",H);
            TextDrawSetString(Health1, string);
            format(string,sizeof(string),"Armour: %0.1f",A);
            TextDrawSetString(Armour1, string);
            format(string,sizeof(string),"Money: %d",GetPlayerMoney(id));
            TextDrawSetString(Money, string);
            format(string,sizeof(string),"Name: %s",RPN(id));
            TextDrawSetString(Name, string);
        }
The playerid (id) is not defined so the server will go for 0. playerb is defined as the id, so you should use that.
Here you go :-

pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
        {
            new id, string[235], Float:H, Float:A;
            GetPlayerHealth(playerb, H); GetPlayerArmour(idplayerbA);
            format(string,sizeof(string),"Health: %0.1f",H);
            TextDrawSetString(Health1, string);
            format(string,sizeof(string),"Armour: %0.1f",A);
            TextDrawSetString(Armour1, string);
            format(string,sizeof(string),"Money: %d",GetPlayerMoney(playerb));
            TextDrawSetString(Money, string);
            format(string,sizeof(string),"Name: %s",RPN(playerb));
            TextDrawSetString(Name, string);
        }
I hope it works.
Reply


Messages In This Thread
Spec problem - by lulo356 - 17.08.2014, 21:08
Re: Spec problem - by SnG.Scot_MisCuDI - 17.08.2014, 21:11
Re: Spec problem - by lulo356 - 17.08.2014, 21:16
Re: Spec problem - by lulo356 - 17.08.2014, 21:56
Re: Spec problem - by iSkate - 17.08.2014, 22:06
Re: Spec problem - by lulo356 - 17.08.2014, 22:25
Re: Spec problem - by iSkate - 17.08.2014, 22:43
Re: Spec problem - by Threshold - 17.08.2014, 23:02
Re: Spec problem - by lulo356 - 17.08.2014, 23:03

Forum Jump:


Users browsing this thread: 2 Guest(s)