Invalid func or declaration
#1

pawn Код:
CMD:mute(playerid, params[])
{
    #if defined mute
    new targetid;
    new reason[128];
    new str[256];
    new AdminName[MAX_PLAYER_NAME];
    new Target[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
    if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage:/mute (playerid/partofname) (reason)");
    else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!");
    else
    {
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        GetPlayerName(targetid, Target, sizeof(Target));
        format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, targetid, reason);
        SendClientMessageToAll(COLOR_RED, str);
        Info[targetid][isMuted] = 1;
    #endif
    }
    return 1;
}
It says invalid function or declaration @ the return 1;
Reply
#2

Quote:
Originally Posted by Sellize
Посмотреть сообщение
pawn Код:
CMD:mute(playerid, params[])
{
    #if defined mute
    new targetid;
    new reason[128];
    new str[256];
    new AdminName[MAX_PLAYER_NAME];
    new Target[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
    if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage:/mute (playerid/partofname) (reason)");
    else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!");
    else
    {
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        GetPlayerName(targetid, Target, sizeof(Target));
        format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, targetid, reason);
        SendClientMessageToAll(COLOR_RED, str);
        Info[targetid][isMuted] = 1;
    #endif
    }
    return 1;
}
It says invalid function or declaration @ the return 1;
pawn Код:
CMD:mute(playerid, params[])
{
    #if defined mute
    new targetid;
    new reason[128];
    new str[256];
    new AdminName[MAX_PLAYER_NAME];
    new Target[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
    if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage:/mute (playerid/partofname) (reason)");
    else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!");
    else
    {
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        GetPlayerName(targetid, Target, sizeof(Target));
        format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, targetid, reason);
        SendClientMessageToAll(COLOR_RED, str);
        Info[targetid][isMuted] = 1;
    }
    #endif
    return 1;
}
Reply
#3

pawn Код:
CMD:mute(playerid, params[])
{
    #if defined mute
    new targetid;
    new reason[128];
    new str[256];
    new AdminName[MAX_PLAYER_NAME];
    new Target[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
    if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage:/mute (playerid/partofname) (reason)");
    else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!");
    else
    {
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        GetPlayerName(targetid, Target, sizeof(Target));
        format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, targetid, reason);
        SendClientMessageToAll(COLOR_RED, str);
        Info[targetid][isMuted] = 1;
    #endif
    return 1;
}
Reply
#4

I was too late lol
Reply
#5

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
pawn Код:
CMD:mute(playerid, params[])
{
    #if defined mute
    new targetid;
    new reason[128];
    new str[256];
    new AdminName[MAX_PLAYER_NAME];
    new Target[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
    if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage:/mute (playerid/partofname) (reason)");
    else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!");
    else
    {
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        GetPlayerName(targetid, Target, sizeof(Target));
        format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, targetid, reason);
        SendClientMessageToAll(COLOR_RED, str);
        Info[targetid][isMuted] = 1;
    #endif
    return 1;
}
You forgot the } before #endif
Reply
#6

Thanks man rep foar yoo
Quote:
Originally Posted by Adytza.
Посмотреть сообщение
You forgot the } before #endif
Reply
#7

pawn Код:
CMD:mute(playerid, params[])
{
    #if defined mute
    new targetid;
    new reason[128];
    new str[256];
    new AdminName[MAX_PLAYER_NAME];
    new Target[MAX_PLAYER_NAME];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
    if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage:/mute (playerid/partofname) (reason)");
    if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GRAY, "User not connected");
    GetPlayerName(playerid, AdminName, sizeof(AdminName));
    GetPlayerName(targetid, Target, sizeof(Target));
    format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, targetid, reason);
    SendClientMessageToAll(COLOR_RED, str);
    Info[targetid][isMuted] = 1;
    #endif
    return 1;
}
And next time, do not join my server for scripting help.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)