Getting tired of this.
#1

Hey guys. I want to make a simple DCMD cmd.

How can this be wrong? XD

pawn Код:
dcmd_setfun(playerid, params[])
{
    new
        id,
        amount;
    if (sscanf(params, "ud", id, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /setfun playerid amount");
    else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    else
    {
        funpoints[id] = amount;
        SendClientMessage(iplayerid, 0xFF0000AA,"you've setted funpoints");
        SendClientMessage(id, 0x00FF00AA, "your funpoints are setted");
    }
    return 1;
}
I really don't see the problem




It just has almost no effect.
Reply
#2

What errors are you getting?
Also you misspelledplayerid on your second to last sendclientmessage
Reply
#3

Oh yea I noticed that I already fixed the playerid misspell. But I've got no errors.

But the return client message to say that's a wrong ID doesn't work

And the funpoints don't getting add
Reply
#4

nvm.
Reply
#5

pawn Код:
dcmd_setfun(playerid, params[])
{
    new id, amount;
    if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /setfun playerid amount");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    else
    {
        funpoints[id] = amount;
        SendClientMessage(playerid, 0xFF0000AA,"you've setted funpoints");
        SendClientMessage(id, 0x00FF00AA, "your funpoints are setted");
    }
    return 1;
}
Reply
#6

pawn Код:
funpoints[id] = strval(amount);
Forgive me if im wrong D:
Reply
#7

Now the onlyy problem is that the funpoints aren't setted.
Reply
#8

How do you check it?
Reply
#9

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
pawn Код:
funpoints[id] = strval(amount);
Forgive me if im wrong D:
Why do you even post if you don't know what you are doing
Reply
#10

It's just this:

new funpoints[MAX_PLAYERS];


funpoints[id] = amount;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)