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;
}
Do not use [256]. Use maximal [128].dcmd_a(playerid, params[])
{
new str[128], input[75], pName[MAX_PLAYER_NAME];
if(sscanf(params, "s", input)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /a [text]");
if(IsPlayerAdmin(playerid) || Spieler[playerid][AdminLevel] > 0){
format(str, 128, "[ADMIN] %s(%d): %s", pName, playerid, input);
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerAdmin(i) || Spieler[playerid][AdminLevel] > 0)
SendClientMessage(i, 0x00FFFFAA, str);
}
return 1;
}
dcmd_a(playerid, params[])
{
new str[128], pName[MAX_PLAYER_NAME];
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /a [text]");
if(IsPlayerAdmin(playerid) || Spieler[playerid][AdminLevel] > 0)
{
format(str, 128, "[ADMIN] %s(%d): %s", pName, playerid, params);
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerAdmin(i) || Spieler[playerid][AdminLevel] > 0)
SendClientMessage(i, 0x00FFFFAA, str);
}
return 1;
}
|
No problem.
And off course it works, I made it ^^. No just kidding. I make mistakes too (alot :P) |
|
I know. I mean I'm not always wrong (just prooved it in another topic)
and btw about the sscanf, about the 's[128]' -> It's not needed. I mean I never use that and it still works. And he also said it's workin |
|
Hmm I'll take a look at it tomorrow :P
Wait , are you using in the scripts the sscanf2 (the plugin) or the older sscanf? 'cuz I'm still using the old one (I'll change soon) |