error 035: argument type mismatch (argument 1)
#1

So i have the same line with "playerid" instead of "giveplayer" and there is no error,only on this line:
Код:
GivePlayerMoney(giveplayer, RepairPrice[playerid]);
(error 035: argument type mismatch (argument 1))

Do you know what is problem?
Reply
#2

Show us lines above please , i mean the whole code!
Reply
#3

Код:
COMMAND:prihvatipopravku(playerid, params[])
{
    If(RepairOffer[playerid] < 999)
    {
            If(GetPlayerMoney(playerid) > RepairPrice[playerid])
	        {
	            If(IsPlayerInAnyVehicle(playerid))
       			{
					new sendername[MAX_PLAYER_NAME];
				 	new RepairCar[MAX_PLAYERS];
					new giveplayer[MAX_PLAYER_NAME],string[256];
				    GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
				    RepairCar[playerid] = GetPlayerVehicleID(playerid);
				    RepairVehicle(RepairCar[playerid]);
					format(string, sizeof(string), "{0049FF}[Popravka] {FFFFFF}Vase auto je popravljeno za $%d od strane mehanicara %s.",RepairPrice[playerid],giveplayer);
					SCM(playerid, PLAVA, string);
					format(string, sizeof(string), "{0049FF}[Popravka] {FFFFFF}Popravio si %s-ovo auto za $%d.",sendername,RepairPrice[playerid]);
					SCM(RepairOffer[playerid], PLAVA, string);
					//SafeGivePlayerMoney(giveplayer, RepairPrice[playerid]);
					SafeGivePlayerMoney(playerid, -RepairPrice[playerid]);
                    RepairOffer[playerid] = 999;
					RepairPrice[playerid] = 0;
					Return 1;
                }
            }
	        Else Return SCM(playerid, CRVENA, "{00A6FF}divClient: {FFFFFF}Nemas dovoljno novca.");
    }
	Return 1;
}
Reply
#4

pawn Код:
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
'giveplayer' is string, you store giveplayerid's name there, try this:
pawn Код:
GivePlayerMoney(RepairOffer[playerid], (0-RepairPrice[playerid])); // -- the cash, not add
GivePlayerMoney(playerid, RepairPrice[playerid]); // ++ the cash to mechanic
Reply
#5

It is working,thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)