11.05.2013, 06:08
Well, you can use something like this:
And after writing that somewhere on your script, you go over the 'OnPlayerText' or wherever you want to use it and do this:
This shall be fine.
Tell me if it works or either not.
EDIT: I saw this '[%s]: %s *[%s]*, atext', you're using text before name, are you sure about that? It's going to be like "Hello server: Private200 *[OnDuty]*". Change the places to fix it like this:
pawn Code:
stock AdminDuty(playerid)
{
new AdminDuty[32];
if(PlayerInfo[playerid][pAdminDuty] == 0) format(AdminDuty, sizeof(AdminDuty), "OffDuty");
else if(PlayerInfo[playerid][pAdminDuty] == 1) format(AdminDuty, sizeof(AdminDuty), "OnDuty/ReadyToHelp");
return AdminDuty;
}
pawn Code:
format(string, sizeof(string), "[%s]: %s *[%s]*", atext, PlayerName(i), AdminDuty);
SendClientMessage(playerid, COLOR_WHITE, string);
Tell me if it works or either not.
EDIT: I saw this '[%s]: %s *[%s]*, atext', you're using text before name, are you sure about that? It's going to be like "Hello server: Private200 *[OnDuty]*". Change the places to fix it like this:
pawn Code:
format(string, sizeof(string), "[%s]: %s *[%s]*", PlayerName(i), atext, AdminDuty);
SendClientMessage(playerid, COLOR_WHITE, string);