SA-MP Forums Archive
[HELP] SendClientMessage with string - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] SendClientMessage with string (/showthread.php?tid=228095)



[HELP] SendClientMessage with string - Amine_Mejrhirrou - 18.02.2011

Yo all
i have a problem ! i want to put somthink like "(player) has turn to zombie"
this is my code & it wont work what'es tha problem plz help

Quote:

new Float:hp, Float:a;
new target = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid,target) <= 1)
{
if(hp < 5)
{
new string[100];
new target[MAX_PLAYERS];
format(string,sizeof(string), "%s turn into a zombie !.", target);
SendClientMessageToAll(RED,string);
}
}




Re: [HELP] SendClientMessage with string - Pooh7 - 18.02.2011

pawn Код:
new Float:hp, Float:a;
new target = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid,target) <= 1)
{
    if(hp < 5)
    {
        new string[100];
        new hPl[MAX_PLAYER_NAME];
        GetPlayerName(target, hPl, sizeof hPl);
        format(string,sizeof(string), "%s turn into a zombie !.", hPl);
        SendClientMessageToAll(RED,string);
    }
}



Re: [HELP] SendClientMessage with string - admantis - 18.02.2011

pawn Код:
new Float:hp, Float:a;
new target = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid,target) <= 1)
{
    if(hp < 5)
    {
        new string[100], targetname[28];
        GetPlayerName(playerid, targetname, sizeof(targetname));
        format(string,sizeof(string), "%s turn into a zombie !.", targetname);
        SendClientMessageToAll(RED,string);
    }
}
Next time use [ pawn ] [ /pawn ] tags please.

EDIT: Damnit, I was slow.