16.01.2011, 19:55
I made these two commands and they don't work;
Could someone tell me what I am doing wrong?
pawn Код:
if(strcmp(cmd, "/saveveh", true) == 0)
{
new file[128];
format(file, sizeof(file), "Vehicles/%s.ini", GetPlayerVehicleID(playerid));
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
new Float:X, Float:Y, Float:Z, Float:A;
GetVehiclePos(vehicleid, X, Y, Z);
GetVehicleZAngle(vehicleid, A);
dini_Create(file);
dini_FloatSet(file, "PosX", X);
dini_FloatSet(file, "PosY", Y);
dini_FloatSet(file, "PosZ", Z);
dini_FloatSet(file, "PosA", A);
SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE-INFO] Vehicle Saved");
}
return 1;
}
if(strcmp(cmd, "/loadveh", true) == 0)
{
new file[128];
for(new i = 1; i <= MAX_VEHICLES; i++)
{
format(file, sizeof(file), "Vehicles/%s.ini", GetPlayerVehicleID(playerid));
if(!fexist(file))
{
return SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE INFO] Vehicles Loaded");
}
CreateVehicle(i, vInfo[vehicleid][vPosX], vInfo[vehicleid][vPosY], vInfo[vehicleid][vPosZ], vInfo[vehicleid][vPosA], random(151), random(151), false);
}
SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE INFO] Vehicles Loaded");
return 1;
}