21.09.2011, 05:27
pawn Код:
enum carsinf
{
vModel,
Float:pX,
Float:pY,
Float:pZ,
Float:pR,
cOwner[MAX_PLAYER_NAME],
cOwned,
}
new CarInfo[MAX_VEHICLES][carsinf];
pawn Код:
COMMAND:car(playerid, params[])
{
new Float:X, Float:Y, Float:Z, Float:R;
new car;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, R);
car = CreateVehicle(411, X, Y, Z, R, 1, 1, 60);
PutPlayerInVehicle(playerid, car, 0);
new model = GetVehicleModel(GetPlayerVehicleID(playerid));
new cid;
cid = GetPlayerVehicleID(playerid);
CarInfo[cid][vModel] = model;
CarInfo[cid][pX] = X;
CarInfo[cid][pY] = Y;
CarInfo[cid][pZ] = Z;
CarInfo[cid][pR] = R;
new nameo[MAX_PLAYER_NAME];
GetPlayerName(playerid, nameo, sizeof(nameo));
CarInfo[cid][cOwner] = nameo;
CarInfo[cid][cOwned] = 1;
new file[256];
format(file, sizeof(file),"Cars/%s.txt",cid);
if(dini_Exists(file))
{
dini_IntSet(file,"Model",CarInfo[cid][vModel]);
dini_FloatSet(file,"posX",CarInfo[cid][pX]);
dini_FloatSet(file,"posY",CarInfo[cid][pY]);
dini_FloatSet(file,"posZ",CarInfo[cid][pZ]);
dini_FloatSet(file,"posR",CarInfo[cid][pR]);
dini_IntSet(file,"Owner",CarInfo[cid][cOwner]);
dini_IntSet(file,"Owned",CarInfo[cid][cOwned]);
}
else
{
dini_Create(file);
dini_IntSet(file,"Model",CarInfo[cid][vModel]);
dini_FloatSet(file,"posX",CarInfo[cid][pX]);
dini_FloatSet(file,"posY",CarInfo[cid][pY]);
dini_FloatSet(file,"posZ",CarInfo[cid][pZ]);
dini_FloatSet(file,"posR",CarInfo[cid][pR]);
dini_IntSet(file,"Owner",CarInfo[cid][cOwner]);
dini_IntSet(file,"Owned",CarInfo[cid][cOwned]);
}
return 1;
}
when i type this command my server shutdown please help me