help pickus not saving
#1

PHP код:
stock LoadPics()
{
    new 
str[256];
    for(new 
i1MAX_WEAPSi++)
    {
        if(
PicIDTaken[i] == 0) continue;
        
format(strsizeof(str), "p%d"i);
        
WeapPic[i][wPickupM] = dini_Int(AddDirFile(dir_pickupfilesstr), "PickupModel");
        
WeapPic[i][wX] = dini_Float(AddDirFile(dir_pickupfilesstr), "X");
        
WeapPic[i][wY] = dini_Float(AddDirFile(dir_pickupfilesstr), "Y");
        
WeapPic[i][wZ] = dini_Float(AddDirFile(dir_pickupfilesstr), "Z");
        
WeapPic[i][wInt] = dini_Int(AddDirFile(dir_pickupfilesstr), "Int");
        
WeapPic[i][wWorld] = dini_Int(AddDirFile(dir_pickupfilesstr), "World");
        
WeapPic[i][wAmmo] = dini_Int(AddDirFile(dir_pickupfilesstr), "Ammo");
        
WeapPic[i][wType] = dini_Int(AddDirFile(dir_pickupfilesstr), "Type");
        
WeapPic[i][wPickup] = CreateDynamicPickup(WeapPic[i][wPickupM], WeapPic[i][wType], WeapPic[i][wX], WeapPic[i][wY], WeapPic[i][wZ], WeapPic[i][wWorld],  WeapPic[i][wInt], -170.0);
        
//CreateDynamic3DTextLabel(str, COLOR_YELLOW, WeapPic[idx][wX], WeapPic[idx][wY], WeapPic[idx][wZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
        
PicIDTaken[i] = 1;
    }
    return 
1;
}
SavePics()
{
    new 
str[256];
    for(new 
i1MAX_WEAPSi++)
    {
        if(
PicIDTaken[i] == 0) continue;
        
format(strsizeof(str), "p%d"i);
        
dini_IntSet(AddDirFile(dir_pickupfilesstr), "PickupModel"WeapPic[i][wPickupM]);
        
dini_FloatSet(AddDirFile(dir_pickupfilesstr), "X"WeapPic[i][wX]);
        
dini_FloatSet(AddDirFile(dir_pickupfilesstr), "Y"WeapPic[i][wY]);
        
dini_FloatSet(AddDirFile(dir_pickupfilesstr), "Z"WeapPic[i][wZ]);
        
dini_IntSet(AddDirFile(dir_pickupfilesstr), "Int"WeapPic[i][wInt]);
        
dini_IntSet(AddDirFile(dir_pickupfilesstr), "World"WeapPic[i][wWorld]);
        
dini_IntSet(AddDirFile(dir_pickupfilesstr), "Ammo"WeapPic[i][wAmmo]);
        
dini_IntSet(AddDirFile(dir_pickupfilesstr), "Type"WeapPic[i][wType]);
    }
    return 
1;

PHP код:
CMD:createpic(playeridparams[])
{
    new 
idsamountFloatwPos[3], string[254], type;
     if (
adlvl[playerid] < 5) return 0;
     if(
sscanf(params"ddd"idsamounttype)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /createpic [weaponid] [amount] [type](Best Types: 2 - 23)");
     if(
type || type 23) return SendClientMessage(playeridCOLOR_RED"Error: Available Types: 1-22 ");
    new 
id GetPicAvailableID();
    
GetPlayerPos(playeridwPos[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), typewPos[0], wPos[1], wPos[2], GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -150.0);
    
format(stringsizeof(string), "You Have Created Pickup ID:%d, Weapon ID:%d, Amount:%d, With ID:%d, Type: %d At Your Location"WeapPic[id][wPickupM],idsWeapPic[id][wAmmo], idtype);
    
SendClientMessage(playeridCOLOR_YELLOWstring);
    
SavePics();
    return 
1;

help please
Reply
#2

Hello!

Can you show us your
PHP код:
GetPicAvailableID(); 
function, please?
Reply
#3

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

Can you show us your
PHP код:
GetPicAvailableID(); 
function, please?
Код:
stock GetPicAvailableID()
{
	for(new i = 1; i<MAX_WEAPS; i++)
	{
	    if(PicIDTaken[i] == 0) return i;
	}
	return -1;
}
Reply
#4

help please
Reply
#5

Код:
stock LoadPics() 
{ 
    new str[256]; 
    for(new i= 1; i < MAX_WEAPS; i++) 
    { 
        if(PicIDTaken[i] == 0) continue; 
        format(str, sizeof(str), "p%d", i); 
        WeapPic[i][wPickupM] = dini_Int(AddDirFile(dir_pickupfiles, str), "PickupModel"); 
        WeapPic[i][wX] = dini_Float(AddDirFile(dir_pickupfiles, str), "X"); 
        WeapPic[i][wY] = dini_Float(AddDirFile(dir_pickupfiles, str), "Y"); 
        WeapPic[i][wZ] = dini_Float(AddDirFile(dir_pickupfiles, str), "Z"); 
        WeapPic[i][wInt] = dini_Int(AddDirFile(dir_pickupfiles, str), "Int"); 
        WeapPic[i][wWorld] = dini_Int(AddDirFile(dir_pickupfiles, str), "World"); 
        WeapPic[i][wAmmo] = dini_Int(AddDirFile(dir_pickupfiles, str), "Ammo"); 
        WeapPic[i][wType] = dini_Int(AddDirFile(dir_pickupfiles, str), "Type"); 
        WeapPic[i][wPickup] = CreateDynamicPickup(WeapPic[i][wPickupM], WeapPic[i][wType], WeapPic[i][wX], WeapPic[i][wY], WeapPic[i][wZ], WeapPic[i][wWorld],  WeapPic[i][wInt], -1, 70.0); 
        //CreateDynamic3DTextLabel(str, COLOR_YELLOW, WeapPic[idx][wX], WeapPic[idx][wY], WeapPic[idx][wZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0); 
        PicIDTaken[i] = 1; 
    } 
    return 1; 
}
are you serious o.o?
you're doing a check for if pickup exist before even loading them? lol

PHP код:
stock LoadPics()
{
    new 
str[256];
    for(new 
i1MAX_WEAPSi++)
    {
        
format(strsizeof(str), "p%d"i);
        if(!
fexist(AddDirFile(dir_pickupfilesstr)))
            continue;
        
WeapPic[i][wPickupM] = dini_Int(AddDirFile(dir_pickupfilesstr), "PickupModel");
        
WeapPic[i][wX] = dini_Float(AddDirFile(dir_pickupfilesstr), "X");
        
WeapPic[i][wY] = dini_Float(AddDirFile(dir_pickupfilesstr), "Y");
        
WeapPic[i][wZ] = dini_Float(AddDirFile(dir_pickupfilesstr), "Z");
        
WeapPic[i][wInt] = dini_Int(AddDirFile(dir_pickupfilesstr), "Int");
        
WeapPic[i][wWorld] = dini_Int(AddDirFile(dir_pickupfilesstr), "World");
        
WeapPic[i][wAmmo] = dini_Int(AddDirFile(dir_pickupfilesstr), "Ammo");
        
WeapPic[i][wType] = dini_Int(AddDirFile(dir_pickupfilesstr), "Type");
        
WeapPic[i][wPickup] = CreateDynamicPickup(WeapPic[i][wPickupM], WeapPic[i][wType], WeapPic[i][wX], WeapPic[i][wY], WeapPic[i][wZ], WeapPic[i][wWorld],  WeapPic[i][wInt], -170.0);
        
//CreateDynamic3DTextLabel(str, COLOR_YELLOW, WeapPic[idx][wX], WeapPic[idx][wY], WeapPic[idx][wZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
        
PicIDTaken[i] = 1;
    }
    return 
1;

Reply
#6

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Код:
stock LoadPics() 
{ 
    new str[256]; 
    for(new i= 1; i < MAX_WEAPS; i++) 
    { 
        if(PicIDTaken[i] == 0) continue; 
        format(str, sizeof(str), "p%d", i); 
        WeapPic[i][wPickupM] = dini_Int(AddDirFile(dir_pickupfiles, str), "PickupModel"); 
        WeapPic[i][wX] = dini_Float(AddDirFile(dir_pickupfiles, str), "X"); 
        WeapPic[i][wY] = dini_Float(AddDirFile(dir_pickupfiles, str), "Y"); 
        WeapPic[i][wZ] = dini_Float(AddDirFile(dir_pickupfiles, str), "Z"); 
        WeapPic[i][wInt] = dini_Int(AddDirFile(dir_pickupfiles, str), "Int"); 
        WeapPic[i][wWorld] = dini_Int(AddDirFile(dir_pickupfiles, str), "World"); 
        WeapPic[i][wAmmo] = dini_Int(AddDirFile(dir_pickupfiles, str), "Ammo"); 
        WeapPic[i][wType] = dini_Int(AddDirFile(dir_pickupfiles, str), "Type"); 
        WeapPic[i][wPickup] = CreateDynamicPickup(WeapPic[i][wPickupM], WeapPic[i][wType], WeapPic[i][wX], WeapPic[i][wY], WeapPic[i][wZ], WeapPic[i][wWorld],  WeapPic[i][wInt], -1, 70.0); 
        //CreateDynamic3DTextLabel(str, COLOR_YELLOW, WeapPic[idx][wX], WeapPic[idx][wY], WeapPic[idx][wZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0); 
        PicIDTaken[i] = 1; 
    } 
    return 1; 
}
are you serious o.o?
you're doing a check for if pickup exist before even loading them? lol

PHP код:
stock LoadPics()
{
    new 
str[256];
    for(new 
i1MAX_WEAPSi++)
    {
        
format(strsizeof(str), "p%d"i);
        if(!
fexist(AddDirFile(dir_pickupfilesstr)))
            continue;
        
WeapPic[i][wPickupM] = dini_Int(AddDirFile(dir_pickupfilesstr), "PickupModel");
        
WeapPic[i][wX] = dini_Float(AddDirFile(dir_pickupfilesstr), "X");
        
WeapPic[i][wY] = dini_Float(AddDirFile(dir_pickupfilesstr), "Y");
        
WeapPic[i][wZ] = dini_Float(AddDirFile(dir_pickupfilesstr), "Z");
        
WeapPic[i][wInt] = dini_Int(AddDirFile(dir_pickupfilesstr), "Int");
        
WeapPic[i][wWorld] = dini_Int(AddDirFile(dir_pickupfilesstr), "World");
        
WeapPic[i][wAmmo] = dini_Int(AddDirFile(dir_pickupfilesstr), "Ammo");
        
WeapPic[i][wType] = dini_Int(AddDirFile(dir_pickupfilesstr), "Type");
        
WeapPic[i][wPickup] = CreateDynamicPickup(WeapPic[i][wPickupM], WeapPic[i][wType], WeapPic[i][wX], WeapPic[i][wY], WeapPic[i][wZ], WeapPic[i][wWorld],  WeapPic[i][wInt], -170.0);
        
//CreateDynamic3DTextLabel(str, COLOR_YELLOW, WeapPic[idx][wX], WeapPic[idx][wY], WeapPic[idx][wZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
        
PicIDTaken[i] = 1;
    }
    return 
1;

still not saving
Reply
#7

in ur create command, make the file before writing into it.

PHP код:
CMD:createpic(playeridparams[])
{
    new 
idsamountFloatwPos[3], string[254], type;
     if (
adlvl[playerid] < 5) return 0;
     if(
sscanf(params"ddd"idsamounttype)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /createpic [weaponid] [amount] [type](Best Types: 2 - 23)");
     if(
type || type 23) return SendClientMessage(playeridCOLOR_RED"Error: Available Types: 1-22 ");
    new 
id GetPicAvailableID();
    
GetPlayerPos(playeridwPos[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), typewPos[0], wPos[1], wPos[2], GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -150.0);
    
format(stringsizeof(string), "You Have Created Pickup ID:%d, Weapon ID:%d, Amount:%d, With ID:%d, Type: %d At Your Location"WeapPic[id][wPickupM],idsWeapPic[id][wAmmo], idtype);
    
SendClientMessage(playeridCOLOR_YELLOWstring);
    new 
str[128];
    
format(strsizeof(str), "p%d"id);
    
dini_Create(str);
    
SavePics();
    return 
1;

Reply
#8

thanks
Edit: by the way i used other system on /createpic then it worked i used your format its not working but thanks because i got idea from you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)