Local Message after Command - 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: Local Message after Command (
/showthread.php?tid=204930)
Local Message after Command -
Jack- - 30.12.2010
How do i make it so that when i do /pass at this one place it sends a local message saying
Colour = Pink}* %Name% Has opened the door as %sex% passes through it *
pawn Код:
//pass command
if(strcmp(cmd, "/pass", true) == 0)
{
if (IsPlayerInRangeOfPoint(playerid, 3, 2592.5398,2801.1086,10.8203))
{// marshalls helipad enter
SafeSetPlayerPos(playerid, 2596.9297,2800.7661,10.8203);
}
else if (IsPlayerInRangeOfPoint(playerid, 3, 2596.9297,2800.7661,10.8203))
{// marshalls helipad exit
SafeSetPlayerPos(playerid, 2592.5398,2801.1086,10.8203);
}
Re: Local Message after Command -
Toreno - 30.12.2010
Here you go, take it and ****** for more info:
pawn Код:
new string[256];
format(string, sizeof(string), "%s has opened the... blah blah"GetPlayerName(playerid));
SendClientMessage(playerid, 0xFF6347AA, string);
Re: Local Message after Command -
Jack- - 30.12.2010
Will that work?
Re: Local Message after Command -
Toreno - 30.12.2010
Quote:
Originally Posted by Jack-
Will that work?
|
That will say only the player's name, with the text "has opened ..."
Re: Local Message after Command -
scripter1 - 30.12.2010
pawn Код:
new string[128], sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if (PlayerInfo[playerid][pSex] == 1) // assuming you have pSex in your script
{
format(string, sizeof(string), "%s opens the door as he passes through it", sendername);
// code for door
}
else if(PlayerInfo[playerid][pSex] == 2)
{
format(string, sizeof(string), "%s opens the door as she passes through it", sendername);
// code for door
}
Re: Local Message after Command -
admantis - 30.12.2010
Assuming he has 'sex' defined as 'he' or 'she', and not as '0, 1, M or F' ..
pawn Код:
format(string, sizeof(string), "%s opens the door as %s passes through it", sendername, PlayerInfo[playerid][pSex]);
But it's not very possible lol