12.03.2011, 01:59
hi,
just put together a code for an admin chat.
It works fine but if i got a space in my text (u know the space between 2 words), everything behind the space does not appear in the admin chat anymore.
Whats the error?
thx in advance.
just put together a code for an admin chat.
It works fine but if i got a space in my text (u know the space between 2 words), everything behind the space does not appear in the admin chat anymore.
Whats the error?
pawn Код:
dcmd_a(playerid,params[])
{
new text[256];
if(Spieler[playerid][AdminLevel] == 0)
{
return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
}
if(sscanf(params,"s[256]",text))
{
new str[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof name);
format(str,sizeof str,"[ADMIN] %s: %s",name,text);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Spieler[i][eingeloggt] == 1)
{
if(Spieler[playerid][AdminLevel] > 0)
{
SendClientMessage(i,0xFF66FFAA,str);
}
}
}
}
}
return 1;
}