any one know what is wrong here ?
#1

pawn Код:
CMD:givemoney(playerid, params[])
{
    if(IsPlayerAdmin2[playerid] == 2)
    {
        new targetid, amouth[128];
        if(sscanf(params, "ud", targetid, amouth)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /givemoney [id] [money]");
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ORANGE, "That player is not online.");
        GivePlayerMoney(targetid,amouth);
        format(amouth, sizeof(amouth), "Admin gived to u $%d",amouth);
        SendClientMessage(targetid, COLOR_RED, amouth);
    }
    return 1;
}
i tryed many ways but still geting this freaking error:
pawn Код:
error 035: argument type mismatch (argument 2)
Thanks
Reply
#2

should it be

Код:
if(IsPlayerAdmin[playerid] == 2)
If not that please show us which line the error is happening.
Reply
#3

dude its not that the reason for the error... :/
the error line is 222 and that line is this one
pawn Код:
GivePlayerMoney(targetid,amouth);
Reply
#4

Quote:
Originally Posted by Rafa
Посмотреть сообщение
dude its not that the reason for the error... :/
the error line is 222 and that line is this one
pawn Код:
GivePlayerMoney(targetid,amouth);
You spelt amount wrong.

try
Код:
GivePlayerMoney(giveplayerid, amount)
Reply
#5

Quote:
Originally Posted by Shockey HD
Посмотреть сообщение
You spelt ammount wrong.

try
Код:
GivePlayerMoney(giveplayerid, amount)
Who cares how he spelled it? He could of had it as dogs.

But your problem is you need to take off the [128] , so just amouth

so like,

new targetid, amouth;
Reply
#6

nope isn't fixed :/
Please someone help !
EDIT: no dude that must stay there
Reply
#7

Quote:
Originally Posted by Rafa
Посмотреть сообщение
nope isn't fixed :/
Please someone help !
EDIT: no dude that must stay there
It can't stay there.
Reply
#8

add a new variable called "string[128]" and remove the [128] off "amouth"

then change these lines:
Код:
format(string, sizeof(string), "Admin gave you $%d", amouth);
SendClientMessage(targetid, COLOR_RED, string);
should work.
Reply
#9

You need to convert that array of characters into a numeral. Try this:
pawn Код:
GivePlayerMoney(targetid,strval(amouth));
Reply
#10

pawn Код:
CMD:givemoney(playerid, params[])
{
   if(IsPlayerAdmin2[playerid] == 2)
    {
        new targetid, amouth, string[128];
        if(sscanf(params, "ud", targetid, amouth)) return SendClientMessage(playerid, -1, "USAGE: /givemoney [id] [money]");
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "That player is not online.");
        GivePlayerMoney(targetid,amouth);
        format(string, sizeof(string), "Admin gived to u $%d",amouth);
        SendClientMessage(targetid, -1, string);
   }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)