Spec help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Spec help (
/showthread.php?tid=511294)
Spec help -
lulo356 - 04.05.2014
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
Re: Spec help -
Abagail - 04.05.2014
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.
Re: Spec help -
Konstantinos - 04.05.2014
"... ~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~..."
Re: Spec help -
lulo356 - 04.05.2014
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
Re: Spec help -
lulo356 - 04.05.2014
playerb is now solved
pawn Код:
new playerb, string[256], Float:H, Float:A;
Re: Spec help -
lulo356 - 04.05.2014
But if you spec someone you see your own stats