is this command wrong?
#5

Yes, you forgot to get the player's name + on the AD command, you used "params" in the format, but I dont see it defined anywhere. For this code to work you need also sscanf2.

pawn Код:
CMD:dice(playerid,params[])
{
    new rand = random(12);
    new sendername[MAX_PLAYER_NAME], message[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(message, sizeof(message), "%s(%d) tries his luck and throws the dice, The dice landed on the number %d",sendername,playerid,rand);
    ProxDetector(30.0, playerid, message,COLOR_LAWNGREEN,COLOR_LAWNGREEN,COLOR_LAWNGREEN,COLOR_LAWNGREEN,COLOR_LAWNGREEN);
    return 1;
}

CMD:ad(playerid,params[])
{
    new sendername[MAX_PLAYER_NAME], string[64], ad[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(sscanf(params,"s[64]", ad)) return SendClientMessage(playerid, FFFFFF, "Usage: /ad [text]");
   
    format(string, sizeof(string),"ADVERTISEMENT: %s, contact %s (ID:%d)", ad, sendername, playerid);
    SendClientMessageToAll(COLOR_ORANGE, string);
    return 1;
}
Reply


Messages In This Thread
is this command wrong? - by ZBits - 18.07.2012, 15:36
Re: is this command wrong? - by LukeStephens - 18.07.2012, 15:38
Re: is this command wrong? - by Andi_Evandy - 18.07.2012, 15:40
Re: is this command wrong? - by Larceny - 18.07.2012, 15:41
Re: is this command wrong? - by Dan. - 18.07.2012, 15:44
Re: is this command wrong? - by ZBits - 18.07.2012, 16:07
Re: is this command wrong? - by Larceny - 18.07.2012, 16:12
Re: is this command wrong? - by Dan. - 18.07.2012, 16:13
Re: is this command wrong? - by ZBits - 18.07.2012, 16:19
Re: is this command wrong? - by Dan. - 18.07.2012, 16:25

Forum Jump:


Users browsing this thread: 2 Guest(s)