SA-MP Forums Archive
playerid not loading - 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: playerid not loading (/showthread.php?tid=634438)



playerid not loading - aoky - 19.05.2017

PHP код:
    if(Character[playerid][BrutalM] == 1)
    {
        
Character[playerid][CanAccept] = 0;
        
SetPlayerPos(playerid, Character[playerid][DPosX], Character[playerid][DPosY], Character[playerid][DPosZ]+1);
        
SetTimerEx("AcceptD", 120000, false, "i", playerid);
        
TogglePlayerControllable(playerid, false);
        
SetTimerEx("ConBrutal", 5000, false, "i", playerid);
        
SetPlayerHealth(playerid, 15.0);
        
format(DTextS, sizeof(DTextS), "(( %s has been injuried several times. /damages %s for more info. ))", GetName(playerid), playerid);
        
label = Create3DTextLabel(DTextS, COLOR_RED, Character[playerid][DPosX], Character[playerid][DPosY], Character[playerid][DPosZ], 10.0, 0);
        
Attach3DTextLabelToPlayer(label, playerid, 0, 0, 0.7);
    } 
What is wrong with this?
PHP код:
format(DTextS, sizeof(DTextS), "(( %s has been injuried several times. /damages %s for more info .))", GetName(playerid), playerid); 
Here is how it looks:




Re: playerid not loading - aoky - 19.05.2017

By the way the names load correctly, that was just a bug. It's just the playerid's that aren't loading correctly.


Re: playerid not loading - Sew_Sumi - 19.05.2017

Playerids are integers.... Use %i instead of %s for the second value.

Код:
format(DTextS, sizeof(DTextS), "(( %s has been injuried several times. /damages %i for more info. ))", GetName(playerid), playerid);



Re: playerid not loading - zedshadowzw - 19.05.2017

Change your %s into %i


Re: playerid not loading - Mohaaaaaaaaaaa - 19.05.2017

Change %s to %d