30.05.2011, 09:06
hey guys I tried to make something like this:
the errors is this:
error 1:
error 2:
error 3:
error 4:
error 5:
error 6:
format(string, sizeof(string),"%d", dini_Get("vprices.cfg",vehicleid));
error:7
canno't read the vehicle id
the file is like this:
http://pastebin.com/U8KZm4Av
help me please
PHP код:
stock checkprice(vehicleid)
{
new string[256];
format(string, sizeof(string),"%d", dini_Get("vprices.cfg",vehicleid));
return string;
}
PHP код:
else if(!strcmp(x_v, "setprice",true))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmi] >= 5000)
{
if (PlayerToPoint(50, playerid,SBizzInfo[12][sbEntranceX],SBizzInfo[12][sbEntranceY],SBizzInfo[12][sbEntranceZ]))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE,"[USAGE]: /setprice [vehiclemodel] [price]");
return 1;
}
new car;
new price;
car = strval(tmp);
price = strval(tmp);
dini_IntSet("vprices.cfg",car,price);
format(string, sizeof(string), "You have set %s's price to $%d ", VehicleNames[car-400],price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not at a dealership !");
return 1;
}
}
}
return 1;
}
else if(!strcmp(x_v, "sellcar",true))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmi] >= 5000)
{
if (PlayerToPoint(50, playerid,SBizzInfo[12][sbEntranceX],SBizzInfo[12][sbEntranceY],SBizzInfo[12][sbEntranceZ]))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE,"[USAGE]: /sellcar [vehiclemodel] [Player's id]");
return 1;
}
new car = strval(tmp);
new price[MAX_STRING];
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, " Vehicle Number can't be below 400 or above 611!"); return 1; }
tmp = strtok(cmdtext, idx);
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(CarsPrices[car-400] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You are not able to sell this vehicle!");
return 1;
}
/*if(HMoney[playerid] < CarsPrices[car-400])
{
SendClientMessage(playerid, COLOR_YELLOW2, " You haven't enough money !");
return 1;
}*/
//new file[256];
//format(file, sizeof(file), "Vehicles/vprice.cfg");
price = checkprice(car);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(!CheckCarF(playerid,car))
{
if(price != 0)
{
pCar[giveplayerid] = car;
pCarPrice[giveplayerid] = price;
pColorS[giveplayerid] = 1;
pColor2S[giveplayerid] = 1;
format(string, sizeof(string), "%s offers to %s %s for $%d", sendername,giveplayer,VehicleNames[car-400],checkprice(car));
ProxDetector(20.0, playerid, string, COLOR_NICEBLUE,COLOR_NICEBLUE,COLOR_NICEBLUE,COLOR_NICEBLUE,COLOR_NICEBLUE);
format(string, sizeof(string), "%s offered you %s for $%d", sendername,VehicleNames[car-400],checkprice(car));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid, COLOR_WHITE, "type /acceptcar if you want to buy or /cancelcar if you dont want to but it");
//BuyingVeh(playerid);
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"The leader didn't ordered this vehicle!");
}
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"That player already has this vehicle!");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not at a dealership !");
return 1;
}
}
}
return 1;
}
PHP код:
cuments and Settings\Vlad\щемзп дтбегд\LS-Mode2.pwn(45527) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Vlad\щемзп дтбегд\LS-Mode2.pwn(45575) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Vlad\щемзп дтбегд\LS-Mode2.pwn(45580) : error 033: array must be indexed (variable "price")
C:\Documents and Settings\Vlad\щемзп дтбегд\LS-Mode2.pwn(45583) : error 006: must be assigned to an array
C:\Documents and Settings\Vlad\щемзп дтбегд\LS-Mode2.pwn(45753) : error 006: must be assigned to an array
C:\Documents and Settings\Vlad\щемзп дтбегд\LS-Mode2.pwn(55968) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Vlad\щемзп дтбегд\LS-Mode2.pwn(55950) : warning 203: symbol is never used: "vehicleid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.
PHP код:
dini_IntSet("vprices.cfg",car,price);
PHP код:
price = checkprice(car);
PHP код:
if(price != 0)
PHP код:
pCarPrice[giveplayerid] = price;
PHP код:
plaprice = file;
format(string, sizeof(string),"%d", dini_Get("vprices.cfg",vehicleid));
error:7
canno't read the vehicle id
the file is like this:
http://pastebin.com/U8KZm4Av
help me please