announcement help?
#1

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
Reply
#2

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!
Reply
#3

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^^
Reply
#4

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!
Reply
#5

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.
Reply
#6

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.
Reply
#7

There is a bracket missing

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


Forum Jump:


Users browsing this thread: 1 Guest(s)