Name To All
#1

How would I make it so if like [Owner]Charlie spawns it will show it on everybody's screen (not textdraw) so like.

[Owner]Charlie Has Spawned!
Reply
#2

you mean to send the message to all the players, if yes just edit your script to: SendClientMessageToAll
Reply
#3

pawn Код:
public OnPlayerSpawn(playerid)
{
new string[128];
format(string, sizeof(string), "%s Has been Spawned!", PlayerName[playerid]);
SendClientMessageToAll(0x33CCFFAA, string);
return 1;
}
0x33CCFFAA = Lightblue

-UPDATE
i forget PlayerName[playerid] ^^,
Reply
#4

add this (tested) : (under OnPlayerSpawn)

Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "[Owner]Charlie") == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"[Owner]Charlie");
}
Reply
#5

thx guys it worked
Reply
#6

Quote:
Originally Posted by Etch ❽ H
add this (tested) : (under OnPlayerSpawn)

Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "[Owner]Charlie") == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"[Owner]Charlie");
}
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "[Owner]Charlie") == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"[Owner]Charlie Is Spawned");
}
and use SendClientMessageToAll, now you see it alone ^^

its better if you see it by all so
Код:
Silox has been spawned
or
Код:
Monkey has been spawned
not only you ^^
--
pawn Код:
public OnPlayerSpawn(playerid)
{
new string[128];
format(string, sizeof(string), "%s Has been Spawned!", PlayerName[playerid]);
SendClientMessageToAll(0x33CCFFAA, string);
return 1;
}
Reply
#7

dude he doesn't need the string he just need it for his name :S
Reply
#8

Ok So It works fine But how Do I make itso It only says It when I request a Class? Because everytime a die and respawn it pops up
Reply
#9

Put it under OnPlayerConnect?
Reply
#10

Oh, here's the code.Put it after OnPlayerSpawn(playerid)

pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "[Owner]Charlie") == 0)
{
SendClientMessageToAll(COLOR_YELLOW,"[Owner]Charlie Has Spawned!");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)