SA-MP Forums Archive
Getting tired of this. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Getting tired of this. (/showthread.php?tid=208628)



Getting tired of this. - bartje01 - 08.01.2011

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.


Re: Getting tired of this. - Joe Staff - 08.01.2011

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


Re: Getting tired of this. - bartje01 - 08.01.2011

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


Re: Getting tired of this. - Joe Staff - 08.01.2011

nvm.


Re: Getting tired of this. - [03]Garsino - 08.01.2011

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;
}



Re: Getting tired of this. - Lorenc_ - 08.01.2011

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


Re: Getting tired of this. - bartje01 - 08.01.2011

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


Re: Getting tired of this. - MadeMan - 08.01.2011

How do you check it?


Re: Getting tired of this. - Sergei - 08.01.2011

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


Re: Getting tired of this. - bartje01 - 08.01.2011

It's just this:

new funpoints[MAX_PLAYERS];


funpoints[id] = amount;