[Help]On Spawn Commands
#1

Hello,

I have started to learn pawn. After using the Wiki and the premade script I have, i figured out this code:
Quote:

//Gteam 0
{
if(gTeam[playerid] != 0)
{
SetPlayerColor(playerid, 0xFFFFFFAA);
}

{
SendClientMessageToAll(COLOR_WHITE, "Welcome To Citzen: ");
}
}

But on "SendClientMessageToAll(COLOR_WHITE, "Welcome To Citzen:<name> ");" I need name to appear on it of the player. Can anyone help me on this?

Thanks,
Bubka3
Reply
#2

SendClientMessageToPlayer(COLOR_WHITE, "Welcome To Citzen");
I think... or just :
SendClientMessage(COLOR_WHITE, "Welcome To Citzen");

I use in my server SendClientMessageToPlayer(COLOR_WHITE, "Welcome To Citzen");

but the name I don't know ,
Reply
#3

That does work, i need the name of the person to appear where <name> is.
Reply
#4

why don't you use Join messages ?

Search on Wiki
Reply
#5

Yes i know it is there. But I cant customize the message for each team. With my code I can (if i can get the name to appear.)
Reply
#6

I get it from my server :

Код:
new pName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Welcome Citzen %s .", pName);
SendClientMessageToAll(COLOR_WHITE, string);
SavePos[playerid][SavedPos] = 1;
use GetPlayerName(playerid, pName, sizeof(pName))
and then use (string, sizeof(string), "Welcome Citzen %s .", pName);

Reply
#7

So
Quote:

//Gteam 0
{
if(gTeam[playerid] != 0)
{
SetPlayerColor(playerid, 0xFFFFFFAA);
}

{
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Welcome Citzen %s .", pName);
SendClientMessageToAll(COLOR_WHITE, string);
}
}

Would Work?
Reply
#8

Do you want to send the message to just the Player or all Players?
Reply
#9

All pLayers
Reply
#10

bubka , I think youre doing right with

Код:
//Gteam 0
{
  if(gTeam[playerid] != 0)
   {
   SetPlayerColor(playerid, 0xFFFFFFAA);
   }
 
   {
  GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Welcome Citzen %s .", pName);
SendClientMessageToAll(COLOR_WHITE, string);
   }
}
Make a copy of your gamemode , chage it and test it .
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)