SA-MP Forums Archive
CMD HELP - 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: CMD HELP (/showthread.php?tid=582319)



CMD HELP - Andy5 - 19.07.2015

How To make /ad Command ?

By Using[ZCMD]


Re: CMD HELP - simo0000 - 19.07.2015

pawn Код:
#define             COLOR_LIME                      0x10F441AA  //(at the top of the script)

CMD:ad(playerid, params[])
{
    new string[128], name[64] ;
    GetPlayerName(playerid, name, sizeof(name));
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ad [Text]");

        format(string, sizeof(string), "[Advertisement] %s Contact: %s", params,name);
        SendClientMessageToAll(COLOR_LIME, string);
        GivePlayerMoney(playerid, -100000);
    }
    return 1;
}



Re: CMD HELP - Andy5 - 19.07.2015

Thanks ^_^


Re: CMD HELP - Andy5 - 19.07.2015

Quote:

C:\Users\ma\Desktop\test.pwn(3821) : warning 217: loose indentation
C:\Users\ma\Desktop\test.pwn(3823) : warning 209: function "cmd_ad" should return a value
C:\Users\ma\Desktop\test.pwn(3824) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error

How to Fix This !!


Re: CMD HELP - gurmani11 - 19.07.2015

pawn Код:
#define             COLOR_LIME                      0x10F441AA  //(at the top of the script)

CMD:ad(playerid, params[])
{
    new string[128], name[64] ;
    GetPlayerName(playerid, name, sizeof(name));
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ad [Text]");

    format(string, sizeof(string), "[Advertisement] %s Contact: %s", params,name);
    SendClientMessageToAll(COLOR_LIME, string);
    GivePlayerMoney(playerid, -100000);
    return 1;
}



Re: CMD HELP - Andy5 - 19.07.2015

Quote:

CMD:ad(playerid, params[])
{
new string[128], name[64] ;
GetPlayerName(playerid, name, sizeof(name));
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ad [Text]");

format(string, sizeof(string), "[AD] %s : %s", params,name);
SendClientMessageToAll(COLOR_ADUTY, string);
return 1;
}

Quote:

C:\Users\ma\Desktop\test.pwn(3821) : warning 217: loose indentation
C:\Users\ma\Desktop\test.pwn(3823) : warning 209: function "cmd_ad" should return a value
C:\Users\ma\Desktop\test.pwn(3824) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error

HOW TO FIX THAT ?


Re: CMD HELP - Glenn332 - 19.07.2015

Quote:
Originally Posted by Andy5
Посмотреть сообщение
HOW TO FIX THAT ?
Make sure that you are not adding the CMD under a public #%*#%


Re: CMD HELP - Andy5 - 19.07.2015

Quote:
Originally Posted by Glenn332
Посмотреть сообщение
Make sure that you are not adding the CMD under a public #%*#%
i added it , Under My Gamemode's CMDS


Re: CMD HELP - gurmani11 - 19.07.2015

loll don't put it there dont put it under any public callback


Re: CMD HELP - Glenn332 - 19.07.2015

Haha made me smile tho