Do you speak French ?
I use the same.
Here, I'll place my order and tries to emulate:
Код:
if(strcmp(cmd, "/veh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid))// Connect in /rcon
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFF00, "[Usage]: /veh [ModelID] [Color1] [Color2]");
return 1;
}
new modelid = strval(tmp);
if(modelid == 0)
{
SendClientMessage(playerid, 0xFFFFFF00, "Model du vйhicule incorrect");
return 1;
}
new color1 = 0;
tmp = strtok(cmdtext, idx);
if(strlen(tmp)) color1 = strval(tmp);
new color2 = 0;
tmp = strtok(cmdtext, idx);
if(strlen(tmp)) color2 = strval(tmp);
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
GetXYFront(x, y, a, 3.0);
new Cveh = CreateVehicle(modelid,x,y,z,a,color1,color2,RESPAWN_DELAY);
VehiculeInfo[Cveh][VehID] = Cveh;
VehiculeInfo[Cveh][Model] = modelid;
VehiculeInfo[Cveh][XSpawn] = x;
VehiculeInfo[Cveh][YSpawn] = y;
VehiculeInfo[Cveh][ZSpawn] = z;
VehiculeInfo[Cveh][ASpawn] = a;
VehiculeInfo[Cveh][Couleur1] = color1;
VehiculeInfo[Cveh][Couleur2] = color2;
VehiculeInfo[Cveh][Prix] = 0;
VehiculeInfo[Cveh][Status] = 0;
VehiculeInfo[Cveh][Alarme] = 0;
VehiculeInfo[Cveh][Tuning0] = 0;
VehiculeInfo[Cveh][Tuning1] = 0;
VehiculeInfo[Cveh][Tuning2] = 0;
VehiculeInfo[Cveh][Tuning3] = 0;
VehiculeInfo[Cveh][Tuning4] = 0;
VehiculeInfo[Cveh][Tuning5] = 0;
VehiculeInfo[Cveh][Tuning6] = 0;
VehiculeInfo[Cveh][Tuning7] = 0;
VehiculeInfo[Cveh][Tuning8] = 0;
VehiculeInfo[Cveh][Tuning9] = 0;
VehiculeInfo[Cveh][Tuning10] = 0;
VehiculeInfo[Cveh][Tuning11] = 0;
VehiculeInfo[Cveh][Tuning12] = 0;
VehiculeInfo[Cveh][Tuning13] = 0;
VehiculeInfo[Cveh][Tuning14] = 0;
VehiculeInfo[Cveh][Tuning15] = 0;
VehiculeInfo[Cveh][Tuning16] = 0;
VehiculeInfo[Cveh][Peinture] = 0;
VehiculeInfo[Cveh][MaxEssence] = 100;
VehiculeInfo[Cveh][Essence] = 100;
Gas[Cveh] = 100;
strmid(VehiculeInfo[Cveh][Proprio], "Aucun", 0, strlen("Aucun"),128);
strmid(VehiculeInfo[Cveh][Nom],VehicleName[modelid-400],0,strlen(VehicleName[modelid-400]),128);
format(string,sizeof(string), "[ID]: %d. Nom: %s. | Vйhicule Crйer",Cveh,VehiculeInfo[Cveh][Nom]);
SendClientMessage(playerid,0xFFFFFF00,string);
PutPlayerInVehicle(playerid, Cveh, 0);
SauvegardeVeh();
}
else
{
SendClientMessage(playerid,0xFFFFFF00, "Vous n'кtes pas autoriser а utilisй cette commande.");
return 1;
}
}
return 1;
}
Note:
Change to variable for saving vehicle:
Код:
public SauvegardeVeh()
{
for(new v = 1; v < MAX_VEHICLES; v++)
{
// code for saving
}
}