Hallo User wie kann ich ein /togooc befehl machen
mein /o cmd:
if(strcmp(cmd, "/o", true) == 0)
{
if (AccountInfo[playerid][AdminLevel] >= 0 || IsPlayerAdmin(playerid))
{
GetPlayerName(playerid, player, sizeof(player));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, ORANGE, "Benutze: /o [nachricht]");
return 1;
}
GetPlayerName(playerid, player, sizeof(player));
format(string, sizeof(string), "[%i]%s: %s" ,playerid,player, cmdtext[2]);
SendClientMessageToAll(ANNOUNCEMENT, string);
printf("%s", string);
}
mfg france