26.01.2018, 08:01
in ur create command, make the file before writing into it.
PHP код:
CMD:createpic(playerid, params[])
{
new ids, amount, Float: wPos[3], string[254], type;
if (adlvl[playerid] < 5) return 0;
if(sscanf(params, "ddd", ids, amount, type)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /createpic [weaponid] [amount] [type](Best Types: 2 - 23)");
if(type < 1 || type > 23) return SendClientMessage(playerid, COLOR_RED, "Error: Available Types: 1-22 ");
new id = GetPicAvailableID();
GetPlayerPos(playerid, wPos[0], wPos[1], wPos[2]);
PicIDTaken[id] = 1;
WeapPic[id][wX] = wPos[0];
WeapPic[id][wY] = wPos[1];
WeapPic[id][wZ] = wPos[2];
WeapPic[id][wWorld] = GetPlayerVirtualWorld(playerid);
WeapPic[id][wInt] = GetPlayerInterior(playerid);
WeapPic[id][wPickupM] = GetWeaponModel(ids);
WeapPic[id][wAmmo] = amount;
WeapPic[id][wType] = type;
WeapPic[id][wPickup] = CreateDynamicPickup(GetWeaponModel(ids), type, wPos[0], wPos[1], wPos[2], GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 50.0);
format(string, sizeof(string), "You Have Created Pickup ID:%d, Weapon ID:%d, Amount:%d, With ID:%d, Type: %d At Your Location", WeapPic[id][wPickupM],ids, WeapPic[id][wAmmo], id, type);
SendClientMessage(playerid, COLOR_YELLOW, string);
new str[128];
format(str, sizeof(str), "p%d", id);
dini_Create(str);
SavePics();
return 1;
}