CMD:b(playerid, params[]) { new textstr[130]; if(sscanf(params, "s[130]", textstr)) { new msg[128], msg2[128]; format(msg, sizeof(msg), "(( %s [%i]: %s ))", PlayerRPName(playerid), playerid, params); ProxDetector(5.0, playerid, msg, COLOR_WHITE, COLOR_GRAD1, COLOR_GRAD2, COLOR_GRAD3, COLOR_GRAD4); format(msg2, sizeof(msg2), "[low]: %s", params); SetPlayerChatBubble(playerid, msg2, COLOR_WHITE, 5.0, 10000); } else return SendUsageMessage("/b [msg]"); return 1; }
CMD:b(playerid, params[]) { new textstr[130]; if(isnull(params)) return SendUsageMessage("/b [msg]"); new msg[128], msg2[128]; format(msg, sizeof(msg), "(( %s [%i]: %s ))", PlayerRPName(playerid), playerid, params); ProxDetector(5.0, playerid, msg, COLOR_WHITE, COLOR_GRAD1, COLOR_GRAD2, COLOR_GRAD3, COLOR_GRAD4); format(msg2, sizeof(msg2), "[low]: %s", params); SetPlayerChatBubble(playerid, msg2, COLOR_WHITE, 5.0, 10000); return 1; }
CMD:b(playerid, params[]) { new textstr[130]; if(isnull(params)) return SendUsageMessage("/b [msg]"); format(textstr, sizeof(textstr), "(( %s [%i]: %s ))", PlayerRPName(playerid), playerid, params); ProxDetector(5.0, playerid, textstr, COLOR_WHITE, COLOR_GRAD1, COLOR_GRAD2, COLOR_GRAD3, COLOR_GRAD4); format(textstr, sizeof(textstr), "[low]: %s", params); SetPlayerChatBubble(playerid, textstr, COLOR_WHITE, 5.0, 10000); return 1; }
public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if(gPlayerLogged[playerid] == 0) return SendErrorPrefix(playerid, "You must be logged in before you can use any command!"); if(!success) { new erstr[130]; format(erstr, sizeof(erstr), "{FFFFFF}[{FF6347}ERROR{FFFFFF}]{FF6347} '%s' has not been found in our database, please use /help.", cmdtext); return SendClientMessage(playerid, COLOR_LIGHTRED, erstr); } printf("[cmd] [%s] %s", PlayerRPName(playerid), cmdtext); return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { return 1; }
Check my topic, I think we HAD the same issuee
https://sampforum.blast.hk/showthread.php?tid=580573 |
stock str_replace(sSearch, sReplace, const sSubject[], &iCount = 0) { new sReturn[128]; format(sReturn, sizeof(sReturn), sSubject); for(new i = 0; i < sizeof(sReturn); i++) { if(sReturn[i] == sSearch) { sReturn[i] = sReplace; } } return sReturn; } stock PlayerRPName(playerid) { new name[MAX_PLAYER_NAME]; strmid(name, str_replace('_', ' ', PlayerName(playerid)), 0, MAX_PLAYER_NAME); return name; }
InGameChatRemoveUnderscore(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); for(new i = strlen(name)-1; i > -1; i--) if(name[i] == '_') name[i] = ' '; return name; } |
CMD:b(playerid, params[]) { new string[128], Localooc[100]; if(sscanf(params, "s[100]", Localooc)) { SendClientMessage(playerid, -1, "USAGE: /(b) [message]"); return 1; } else { format(string, sizeof(string), "%s:((%s))!",GetName(playerid),Localooc); ProxDetector(50.0, playerid, string, -1); } return 1; }
CMD:b(playerid, params[]) { new textstr[130]; format(textstr, sizeof(textstr), "(( %s [%i]: %s ))", PlayerRPName(playerid), playerid, params); ProxDetector(5.0, playerid, textstr, COLOR_WHITE, COLOR_GRAD1, COLOR_GRAD2, COLOR_GRAD3, COLOR_GRAD4); }
CMD:b(playerid, params[])
{
new textstr[130];
format(textstr, sizeof(textstr), "(( %s [%i]: %s ))", ReplaceString("_", " ", PlayerName(playerid)), playerid, params);
ProxDetector(5.0, playerid, textstr, COLOR_WHITE, COLOR_GRAD1, COLOR_GRAD2, COLOR_GRAD3, COLOR_GRAD4);
}
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
stock ReplaceString(search[], replace[], source[])
{
new string[256], length;
for(new i = 0; i < strlen(source); i ++)
{
if(strlen(search) > 1 && i != (strlen(source) - 1))
{
new bool:match = false, start = i;
for(new j = 0; j < strlen(search) && !match; j ++)
{
if(source[i] != search[j] && j == 0)
{
string[length] = source[i];
match = true;
}
else
{
if(source[i] == search[j]) i ++;
else match = true;
}
}
if(match == true)
{
while(start <= i)
{
string[length] = source[start];
length ++;
start ++;
}
}
else
{
for(new j; j < strlen(replace); j ++)
{
string[length] = replace[j];
length ++;
}
i = (start + (strlen(search) - 1));
}
}
else
{
if(strlen(search) == 1 && source[i] == search[0])
{
for(new j; j < strlen(replace); j ++)
{
string[length] = replace[j];
length ++;
}
}
else
{
string[length] = source[i];
length ++;
}
}
}
string[length] = EOS;
return string;
}