PDA

View Full Version : error 035: argument type mismatch (argument 1)


StreetboyBalkan
06/12/2013, 05:37 PM
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?

SilentSoul
06/12/2013, 05:41 PM
Show us lines above please , i mean the whole code!

StreetboyBalkan
06/12/2013, 05:45 PM
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;
}

erminpr0
06/12/2013, 06:08 PM
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));

'giveplayer' is string, you store giveplayerid's name there, try this:
GivePlayerMoney(RepairOffer[playerid], (0-RepairPrice[playerid])); // -- the cash, not add
GivePlayerMoney(playerid, RepairPrice[playerid]); // ++ the cash to mechanic

StreetboyBalkan
06/12/2013, 09:18 PM
It is working,thank you :)