Spec help
#1

pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
        {
            new string[64];
            format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~n~~r~Health:%d Money:%d", PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pMoney]);
            GameTextForPlayer(playerid, string,1000, 3);
        }
This is my code, but if i enter the game, it will crash my own game, how to fix it

+rep for helping me
Reply
#2

Health should be a float, not a variable. You also stated that when you ENTER the game, it crashes, not when you spectate someone, or are in spectating mode.
Reply
#3

"... ~n~~n~n~~r~ ..." - You forgot a ~ and that caused the client crash.

Change to: "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~..."
Reply
#4

pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
        {
            new string[256], Float:H, Float:A;
            GetPlayerHealth(playerb, H); GetPlayerArmour(playerb, A);
            format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~ Health: [%0.1f] Armor: [%0.1f]",H , A);
            GameTextForPlayer(playerid, string,1000, 3);
        }
pawn Код:
C:\Users\Davey\Desktop\Nieuwe map\new scripts\d-rp.pwn(25036) : error 017: undefined symbol "playerb"
C:\Users\Davey\Desktop\Nieuwe map\new scripts\d-rp.pwn(25036) : error 017: undefined symbol "playerb"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
i forgot what to do now XD
Reply
#5

playerb is now solved

pawn Код:
new playerb, string[256], Float:H, Float:A;
Reply
#6

But if you spec someone you see your own stats
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)