Posts: 59
Threads: 24
Joined: Mar 2014
Reputation:
0
Hello guys i need urgent help on this.
I want a script which makes me chat like this.
RedbullGD/The player name <yo yo or whatever i want here> Hey or what ever i type
so for the yoyo section i want a command to change it to what ever i want and that command is /settext
and the hey section i want to type anything.
So what basically i need is a script that lets me have a tag or something see?
Plz help if u don't understand me plz reply
Posts: 621
Threads: 174
Joined: Nov 2013
Can you please explain more??
Posts: 621
Threads: 174
Joined: Nov 2013
Try this
Код:
//At the top of your script
new yoyoprefix[MAX_PLAYERS];
new redbullprefix[MAX_PLAYERS];
Код:
CMD:setyoyoprefix(playerid, params[])
{
if(!IsPlayerConnected(playerid) return SendClientMessage(playerid, -1, "Your Message here when player is not connected!");
yoyoprefix[playerid] = 1;
redbullprefix[playerid] = 0;
SendClientMessage(playerid, -1, "You have set your prefix to yoyo. Everytime you talk you have [YOYO] at your name);
return 1;
}
CMD:setredbullprefix(playerid, params[])
{
if(!IsPlayerConnected(playerid) return SendClientMessage(playerid, -1, "Your Message here when player is not connected!");
redbullprefix[playerid] = 1;
yoyoprefix[playerid] = 0;
SendClientMessage(playerid, -1, "You have set your prefix to RedBull. Everytime you talk you have [RedBull] at your name);
}
Add this below OnPlayerText:
Код:
if(yoyoprefix[playerid] == 1)
{
new name[MAX_PLAYER_NAME];
new str[128];
GetPlayerName(playerid, name, 30);
format(str, sizeof(str), "[YOYO] %s says: %s", name, text);
SendClientMessageToAll(-1, str);
return 0;
}
if(redbullprefix[playerid] == 1)
{
new name[MAX_PLAYER_NAME];
new str[128];
GetPlayerName(playerid, name, 30);
format(str, sizeof(str), "[RedBull] %s says: %s", name, text);
SendClientMessageToAll(-1, str);
return 0;
}
if(redbullprefix[playerid] == 0 || yoyoprefix[playerid] == 0)
{
new name[MAX_PLAYER_NAME];
new str[128];
GetPlayerName(playerid, name, 30);
format(str, sizeof(str), "[No Prefix] %s says: %s", name, text);
SendClientMessageToAll(-1, str);
return 0;
}