04.11.2011, 17:30
i made this :
I just want that the admin can say something to all players not a admin chat i did wrong sorry xD
EDIT: Thanks it works !
pawn Код:
stock SendMessage(playerid, color, type[], {Float,_}:...)
{
new
string[128];
for(new i = 0; i < numargs() - 2; i++)
{
switch(type[i])
{
case 's':
{
new
result[128];
for(new a = 0; getarg(i + 3, a) != 0; a++)
{
result[a] = getarg(i + 3, a);
}
if(!strlen(string))
{
format(string, sizeof(string), "%s", result);
} else format(string, sizeof(string), "%s%s", string, result);
}
case 'i':
{
new
result = getarg(i + 3);
if(!strlen(string))
{
format(string, sizeof(string), "%i", result);
} else format(string, sizeof(string), "%s%i", string, result);
}
case 'f':
{
new
Float:result = Float:getarg(i + 3);
if(!strlen(string))
{
format(string, sizeof(string), "%f", result);
} else format(string, sizeof(string), "%s%f", string, result);
}
}
}
SendClientMessage(playerid, color, string);
return 1;
}
stock SendMessageToAll(color, type[], {Float,_}:...)
{
new
string[128];
for(new i = 0; i < numargs() - 2; i++)
{
switch(type[i])
{
case 's':
{
new
result[128];
for(new a = 0; getarg(i + 3, a) != 0; a++)
{
result[a] = getarg(i + 3, a);
}
if(!strlen(string))
{
format(string, sizeof(string), "%s", result);
} else format(string, sizeof(string), "%s%s", string, result);
}
case 'i':
{
new
result = getarg(i + 3);
if(!strlen(string))
{
format(string, sizeof(string), "%i", result);
} else format(string, sizeof(string), "%s%i", string, result);
}
case 'f':
{
new
Float:result = Float:getarg(i + 3);
if(!strlen(string))
{
format(string, sizeof(string), "%f", result);
} else format(string, sizeof(string), "%s%f", string, result);
}
}
}
SendClientMessageToAll(color, string);
return 1;
}
EDIT: Thanks it works !