SA-MP Forums Archive
command CMD not even working!! - 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)
+--- Thread: command CMD not even working!! (/showthread.php?tid=432730)



command CMD not even working!! - Fredrick - 23.04.2013

all i know i translated it to ZCMD command but its not working dose anyone know why?

Код:
CMD:ban(playerid ,params[])
{
    new pName[MAX_PLAYER_NAME] , pName2[MAX_PLAYER_NAME] , targetid , reason[64] , string[128] , stringbig[256] , YEAR_string[5], Year, Month, Day;
    GetPlayerName(targetid, pName, sizeof(pName));\
    GetPlayerName(playerid, pName2, sizeof(pName2));
    getdate(Year, Month, Day);
    if(!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params, "us[80]", targetid ,reason))  return SendClientMessage(playerid, COLOR_WHITE, "SERVER: "COL_GREEN"/ban [playerid/partofname] [reason]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: "COL_RED" Player not connected or is yourself!");
    format(string, sizeof(string), "SERVER: "COL_RED"%s "COL_GREEN"has been banned "COL_RED"(Reason: %s)",pName, reason);
    SendClientMessageToAll(COLOR_WHITE, string);
    format(YEAR_string, sizeof(YEAR_string), "%d", Year);
    strdel(YEAR_string, 0, 2);
    format(stringbig, sizeof(stringbig),"~b~Reason: ~w~ %s ~n~~b~Banned By: ~w~ %s ~n~~b~Date: ~w~ %d/%d/%s",reason,pName2,Month, Date, YEAR_string);
    TextDrawSetString(Info[playerid] , stringbig);
    TextDrawShowForPlayer(playerid, Info[playerid]);
    TextDrawShowForPlayer(playerid, Box[playerid]);
    TextDrawShowForPlayer(playerid, BannedNotice[playerid]);
    TextDrawShowForPlayer(playerid, Site[playerid]);
    Ban(targetid);
    return 1;
}



Re: command CMD not even working!! - zDivine - 23.04.2013

Well I noticed one error:
pawn Код:
GetPlayerName(targetid, pName, sizeof(pName));\
Remove the '\' at the end of the line.


Re: command CMD not even working!! - Fredrick - 24.04.2013

Thanks pal didnt even see that you must have big eyes to see it


Re: command CMD not even working!! - zDivine - 24.04.2013

Quote:
Originally Posted by Fredrick
Посмотреть сообщение
Thanks pal didnt even see that you must have big eyes to see it
Haha, not big, I just pay attention. :P