06.03.2015, 15:25
Hello EveryOne
i Want Help / Y_ini Saving The Vehicles
this my code its working with out y_ini saving :/
now i want it saving with y_ini
can somone help me with complete the saving float car and vehicles id please ?
+rep
i Want Help / Y_ini Saving The Vehicles
this my code its working with out y_ini saving :/
PHP код:
CMD:cars(playerid, params[])
{
if(sscanf(params, "i", params[0]))
return SendClientMessage(playerid, -1, "usage: /cars [id 1-7].");
switch(params[0])
{
case 1:
{
if(GetPlayerMoney(playerid) < 1200000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -1200000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(541, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) < 1900000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -1900000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(411, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) < 4000000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -4000000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(494, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) < 22000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -22000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(409, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 5:
{
if(GetPlayerMoney(playerid) < 460000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -460000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(560, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 6:
{
if(GetPlayerMoney(playerid) < 600000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -600000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(506, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 7:
{
if(GetPlayerMoney(playerid) < 5000000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -5000000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(521, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
}
return true;
}
PHP код:
#define CarPath "Cars/%s.ini"
enum PlayercInfo
{
PlayerName[20],
Car1Model,
Float:CarX1,
Float:CarY1,
Float:CarZ1,
Float:CarA1,
Car2Model,
Float:CarX2,
Float:CarY2,
Float:CarZ2,
Float:CarA2,
Car3Model,
Float:CarX3,
Float:CarY3,
Float:CarZ3,
Float:CarA3,
}
new cInfo[MAX_PLAYERS][PlayercInfo];
PHP код:
stock Path(playerid) //Will create a new stock so we can easily use it later to load/save user's data in user's path
{
new str[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),CarPath,name);
return str;
}
+rep