SA-MP Forums Archive
announcement help? - 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: announcement help? (/showthread.php?tid=163704)



announcement help? - Kevin_Joshen - 28.07.2010

Hey there,

I have a stunt server, and i need to have people be able to type, for instance, /lsair. And then when they type it, send a message to all (via chat box) saying "blah_blah Has Teleported To The Los Santos Airport"


where

blah_blah = the player who typed in the command

Has Teleported To = a message

The Los Santos Airport = the TP title.


i need it to say that anyplayer who TP's anywhere to be annnounced in the main chat.

Thanks for helping!!
-Kevin


Re: announcement help? - Jeffry - 28.07.2010

Add to your command:

pawn Код:
new Name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, Name, sizeof(Name);
format(string, 128, "Server: %s (ID:%d) has teleported to Area 51", Name, playerid); //Change ''Area 51'' to whatever you teleport to.
SendClientMessageToAll(0xFF00FFFF, string);
I hope this helps you.

Cheers!


Re: announcement help? - Mauzen - 28.07.2010

Hi,
check https://sampwiki.blast.hk/wiki/SendClientMessageToAll and https://sampwiki.blast.hk/wiki/format

for adding the tp target you can e.g. add an if-check to write the matching target to a string and then use this string in format.

Edit: Oops, Jeffry was faster^^


Re: announcement help? - Kevin_Joshen - 28.07.2010

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
Add to your command:

pawn Код:
new Name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, Name, sizeof(Name);
format(string, 128, "Server: %s (ID:%d) has teleported to Area 51", Name, playerid); //Change ''Area 51'' to whatever you teleport to.
SendClientMessageToAll(0xFF00FFFF, string);
I hope this helps you.

Cheers!
thank you, but how do i make it so that it does that for every TP?

ex.

someone types /area51
someone else types /bigjump

i need it to say in the chat

"Someone_1 Has Teleported To Area 51!"
"Someone_2 Has Teleported To Big Jump!"

Thanks!


Re: announcement help? - Mauzen - 28.07.2010

You can just add his code to every of your TP commands, just change the tp target (Area 51) in the text for each command.


Re: announcement help? - Kevin_Joshen - 28.07.2010

i get this one error;


C:\Users\owner\Desktop\my samp server\my samp server - Copy\gamemodes\stunt.pwn(3290) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: announcement help? - Mauzen - 28.07.2010

There is a bracket missing

GetPlayerName(playerid, Name, sizeof(Name);
should be:
GetPlayerName(playerid, Name, sizeof(Name));