Mute command error's - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mute command error's (
/showthread.php?tid=111221)
Mute command error's -
jaksimaksi - 30.11.2009
Hi there i'm using this mute command:
Код:
public OnPlayerText(playerid, text[]) <----- (503)
{
if(Muted[playerid] == 1)
{
SendClientMessage(playerid, RED, " You are muted and cannot talk. ");
return 0; <----- (506)
}
return 1; <----(508)
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, " /mute ", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, color, " Usage: /mute [id] ");
new giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, color, " Player not connected ! ");
new name[24], name2[24], str[128];
GetPlayerName(playerid, name, 24);
GetPlayerName(giveplayerid, name2, 24);
format(str, sizeof str, " Administrator %s has muted %s ", name, name2);
SendClientMessageToAll(color, str);
Muted[giveplayerid] = 1;
return 1;
}
else return SendClientMessage(playerid, color, " Not an administrator! ");
}
return 0;
}
But i've have these 3 errors:
Код:
(503)error 010: invalid function or declaration
(506)error 010: invalid function or declaration
(508)error 010: invalid function or declaration
Whats wrong?
Re: Mute command error's -
[NYRP]Mike. - 30.11.2009
at the top of your script add [new]new Muted[MAX_PLAYERS];[/pawn]
Re: Mute command error's -
Rac3r - 30.11.2009
It would say undefined if he didn't create a new var.
Check your brackets jaksimaksi, I reckon you've kept one open, so the script reads the callbacks as part of the previous function. { }