How can i create a message that displays your id, and create checkpoints? -
CSMajor - 03.10.2010
Well i want to make it so when someone talks it will display: Note(its global chat)
Код:
CSMajor: [5] <--- this is what i want it to display (Then the text goes right after the id)
i cannot figure out how to do this stupid thing.
The checkpoints are getting on my nervers -.- how do i make them?
Re: How can i create a message like... -
Rachael - 03.10.2010
It depends what kind of chat - global / local.
Look under OnplayerText, and see if there is a format command you can change.
eg
pawn Код:
public OnPlayerText(playerid,text[])
{
new string[164],name[24];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"%s [%d] : %s",name,playerid,text);
ProxDetector(20.0,playerid,string,0xAFAFAFAA);
return 0;
}
and you will need these in your script too
pawn Код:
stock ProxDetector(Float:radi, playerid, string[],color)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerVirtualWorld(i) == virtualworld)
{
if(GetPlayerInterior(i) == interior)
{
new Float:dist = GetDistanceBetweenPlayers(i,playerid);
if(dist < radi && dist > 0)
{
SendClientMessage(i, color, string);
}
}
}
}
}
return 1;
}
stock Float:GetDistanceBetweenPlayers(p1,p2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
{
return -1.00;
}
if(!GetPlayerInterior(p1) != !GetPlayerInterior(p2))
{
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x2,y2,z2);
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
I have not tested any of this but you should be able to get it working.
Re: How can i create a message like... -
CSMajor - 03.10.2010
there is an easier way. I know because another server owner only needed about 5 lines to complete it.
Re: How can i create a message like... -
Seven. - 03.10.2010
pawn Код:
new string[128];
format(string, sizeof(string), "[%i] %s",playerid, text);
SendPlayerMessageToAll(playerid,string);
Re: How can i create a message like... -
Rachael - 03.10.2010
I think you are talking about SendPlayerMessageToAll
https://sampwiki.blast.hk/wiki/SendPlayerMessageToAll
I don't use this command, but something like this may work.
pawn Код:
public OnPlayerText(playerid,text[])
{
new string[164];
format(string,sizeof(string),"[%d] : %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
Re: How can i create a message like... -
CSMajor - 03.10.2010
that does not work, the output is:
CSMajor: [hi] [0] <-- this is right
CSMajor: hi <-- this displays right below it.
Re: How can i create a message like... -
CSMajor - 03.10.2010
Also can someone help me fix my map icon problem?
I have this code right here in the onplayerconnect callback :
Код:
SetPlayerMapIcon( playerid, 12, 1939.7401, 2076.4077, 10.8203, 55, 0 );
SetPlayerMapIcon( playerid, 13, 2204.9468, 1986.2877, 16.7380, 52, 0 );
yet if i go in game and go to the map. It shows diddo -.- how can i get this to work?
Re: How can i create a message like... -
CSMajor - 03.10.2010
Also is there an id for a red chekcpoint? not an un textured one....
Re: How can i create a message like... -
Seven. - 03.10.2010
Quote:
Originally Posted by Seven.
pawn Код:
new string[128]; format(string, sizeof(string), "[%i] %s",playerid, text); SendPlayerMessageToAll(playerid,string);
|
Mine did..
Re: How can i create a message like... -
Steven82 - 03.10.2010
Quote:
Originally Posted by CSMajor
Also is there an id for a red chekcpoint? not an un textured one....
|
......
Heres the wiki link
SetPlayerCheckpoint
But to view more than 1 checkpoint a player, your going to need a checkpoint streamer.