PHP код:
if(!strcmp(cmd,"/s",true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid,0xF5D03CAA, "' Не верная команда /carhelp или /авто для просмотра команд '");
return 1;
}
if(!strcmp(tmp,"Sell",true))
{
if(IsPlayerInAnyVehicle(playerid))
{
new Car = GetPlayerVehicleID(playerid);
new result;
new cid;
new pName[60];
new m;
GetPlayerName(playerid,pName,60);
for(new i;i<MAX_AIR;i++)
{
if(Car == Samol[i][cCarID])
{
result = 1;
cid = i;
break;
}
else result = 0;
}
if(result == 1)
{
if(!strcmp(pName, Samol[cid][cOwner]))
{
m = Samol[cid][cCoast];
m /= 2;
Give_Money(playerid,m);
Samol[cid][Cuplena] = 0;
Samol[cid][parkx] = Samol[cid][xcx];
Samol[cid][parky] = Samol[cid][xcy];
Samol[cid][parkz] = Samol[cid][xcz];
Samol[cid][pugol] = Samol[cid][xcrot];
format(Samol[cid][cOwner],60,"Sell");
new str[256];
new str2[60];
format(str,256,"%d,%f,%f,%f,%f,%f,%f,%f,%f,%d,%s,%d,%d,%d", Samol[cid][cModel], Samol[cid][xcx], Samol[cid][xcy], Samol[cid][xcz], Samol[cid][xcrot], Samol[cid][parkx], Samol[cid][parky], Samol[cid][parkz], Samol[cid][pugol], Samol[cid][cCoast], Samol[cid][cOwner], Samol[cid][cColor1], Samol[cid][cColor2], Samol[cid][Cuplena]);
format(str2,60,"%i",cid);
dini_Set("BuyAll/Aero.ini",str2,str);
pStats[playerid][Myyaht] = 0;
RemovePlayerFromVehicle(playerid);
DestroyVehicle(Car);
Samol[cid][cCarID] = CreateVehicle(Samol[cid][cModel],Samol[cid][xcx],Samol[cid][xcy],Samol[cid][xcz],Samol[cid][xcrot],Samol[cid][cColor1],Samol[cid][cColor2], 500);
DelTextPlan();
TextPlan();
new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(playerid));
PlayerVehicleModelID -= 400;
format(GlobalInfo,sizeof(GlobalInfo),"..::|| ''%s'' продал %s ||::..", PlayerName(playerid), PlayerVehicle[PlayerVehicleModelID]);
SendClientMessageToAll(0x31CEB3AA, GlobalInfo);
}
else
{
SellCar(playerid);
return 1;
}
}
else
{
SellCar(playerid);
return 1;
}
}
else
{
SellCar(playerid);
return 1;
}
}