29.12.2012, 10:34
About Strings
29.12.2012, 14:23
There is a function for that here
https://sampforum.blast.hk/showthread.php?tid=38965
https://sampforum.blast.hk/showthread.php?tid=38965
29.12.2012, 14:37
Your chat string variable is probably to small. Make it a bit larger.
30.12.2012, 09:09
30.12.2012, 09:56
Well show your code so we don't have to incorrectly guess whats wrong with it.
30.12.2012, 09:56
Don't be afraid of, the max lenght of string for chat is 128, just use that.
30.12.2012, 09:59
30.12.2012, 10:04
You probably have something like this:
Notice how the string we are formatting, is actually less string length than our text length? This is most likely what you have done.
EDIT: Or possibly the other way around
pawn Код:
CMD:chat(playerid, params[])
{
new string[128];
if(sscanf(params, "s", string)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /chat [text]");
new string2[60];
format(string2,sizeof(string2),"Admin: %s", string);
SendClientMessageToAll(0xFFFF00FF, string2);
return 1;
}
EDIT: Or possibly the other way around
30.12.2012, 10:08
I'm not sure then, can you please post the part of code that you used for that line (the half of the text).
31.12.2012, 11:44
Quote:
I'm not sure then, can you please post the part of code that you used for that line (the half of the text).
|
pawn Код:
CMD:a(playerid, params[])
{
new str[128], text[100];
if(PlayerInfo[playerid][Admin] >=1)
{
if(sscanf(params, "s", text)) return SendClientMessage(playerid, COLOR_GREY, "Syntax: /(a)dminchat [Text]");
if(PlayerInfo[playerid][Admin] == 1)
{
format(str, sizeof(str), "(( Helping Hand %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] == 2)
{
format(str, sizeof(str), "(( Mini-Moderator %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] == 3)
{
format(str, sizeof(str), "(( Moderator %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] == 4)
{
format(str, sizeof(str), "(( Super Moderator %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] == 5)
{
format(str, sizeof(str), "(( Administrator %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] == 6)
{
format(str, sizeof(str), "(( Head Administrator %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] == 7)
{
format(str, sizeof(str), "(( Lead Administrator %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] == 8)
{
format(str, sizeof(str), "(( Assistant Director %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] ==9)
{
format(str, sizeof(str), "(( Director %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(PlayerInfo[playerid][Admin] ==10)
{
format(str, sizeof(str), "(( Executive Director %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
else if(IsPlayerAdmin(playerid))
{
format(str, sizeof(str), "(( RCON Administrator %s : %s ))", GetName(playerid), text);
SendMessageToAdmins(ADMIN_CHAT, str);
}
}
else
{
SendClientMessage(playerid, COL_RED, "ERROR: You are not an Admin");
}
return 1;
}
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)