lil help
#1

when i do /createlaw1 the file wont create on myserver/gang/%i.txt
pawn Код:
CMD:createlaw1(playerid, params[])
{
    new str[128],wep1,wep2,wep3,id, ammo, name[40], file[256];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
    if(sscanf(params,"uiiiis", id,wep1,wep2,wep3,ammo,name)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /createlaw1 [id] [wep1] [wep2] [wep3] [ammo] [name]");
    if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
    if(wep1 > 0 && wep1 < 36)
    if(wep2 > 0 && wep2 < 36)
    if(wep3 > 0 && wep3 < 36)
    {
        if(ammo > 0 && ammo < 5000)
        {
            format(str, sizeof(str), "An Admin has set you the leader of %s",name);
            SendClientMessage(id,0xFF9900AA, str);
            IsLaw[id] = 1;
            Member[id] = 1;
            Leader[id] = 1;
            IsInOrg[id] = 1;
            GivePlayerWeapon(id,wep1, ammo);
            GivePlayerWeapon(id,wep2, ammo);
            GivePlayerWeapon(id,wep3, ammo);
            format(str,sizeof(str),"myserver/gang/%i.txt");
            if(dini_Exists(str))return SendClientMessage(playerid,0xFF0000FF,"Error: That org is already created");
            if(dini_Exists(file))
            {
            dini_Create(file);
            dini_IntSet(str,"Ammo",ammo);
            dini_IntSet(str,"Weapon1",wep1);
            dini_IntSet(str,"Weapon2",wep2);
            dini_IntSet(str,"Weapon3",wep3);
            dini_Set(str,"Leader",name);
            dini_Set(str,"Org Name",name);
            }
            return 1;
            }
        else return SendClientMessage(playerid,0xFF0000FF, "Ammo must be between 0 And 5000.");
    }
    else
    {
        SendClientMessage(playerid,0xFF0000FF, "Invalid Weapon ID!");
    }
    return 1;
}
Reply
#2

Because you haven't assigned an integer to the format() function.

pawn Код:
format(str,sizeof(str),"myserver/gang/%i.txt", id);
Reply
#3

well i add it to number
pawn Код:
CMD:createlaw1(playerid, params[])
{
    new str[128],number = 1,wep1,wep2,wep3,id, ammo, name[40], file[256];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
    if(sscanf(params,"uiiiis", id,wep1,wep2,wep3,ammo,name)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /createlaw1 [id] [wep1] [wep2] [wep3] [ammo] [name]");
    if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
    if(wep1 > 0 && wep1 < 36)
    if(wep2 > 0 && wep2 < 36)
    if(wep3 > 0 && wep3 < 36)
    {
        if(ammo > 0 && ammo < 5000)
        {
            format(str, sizeof(str), "An Admin has set you the leader of %s",name);
            SendClientMessage(id,0xFF9900AA, str);
            IsLaw[id] = 1;
            Member[id] = 1;
            Leader[id] = 1;
            IsInOrg[id] = 1;
            GivePlayerWeapon(id,wep1, ammo);
            GivePlayerWeapon(id,wep2, ammo);
            GivePlayerWeapon(id,wep3, ammo);
            format(str,sizeof(str),"myserver/gang/%i.txt",number);
            if(dini_Exists(str))return SendClientMessage(playerid,0xFF0000FF,"Error: That org is already created");
            if(dini_Exists(file))
            {
            dini_Create(file);
            dini_IntSet(str,"Ammo",ammo);
            dini_IntSet(str,"Weapon1",wep1);
            dini_IntSet(str,"Weapon2",wep2);
            dini_IntSet(str,"Weapon3",wep3);
            dini_Set(str,"Leader",name);
            dini_Set(str,"Org Name",name);
            }
            return 1;
            }
        else return SendClientMessage(playerid,0xFF0000FF, "Ammo must be between 0 And 5000.");
    }
    else
    {
        SendClientMessage(playerid,0xFF0000FF, "Invalid Weapon ID!");
    }
    return 1;
}
but it stil wont work :!(
Reply
#4

You NEED to use the format I gave you. It uses YOUR id integer.

I'm only expecting common sense...
Reply
#5

Tanush i explained to you....

pawn Код:
CMD:createlaw1(playerid, params[])
{
    new str[128],number = 1,wep1,wep2,wep3,id, ammo, name[40];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
    if(sscanf(params,"uiiiis", id,wep1,wep2,wep3,ammo,name)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /createlaw1 [id] [wep1] [wep2] [wep3] [ammo] [name]");
    if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
    if(wep1 > 0 && wep1 < 36)
    if(wep2 > 0 && wep2 < 36)
    if(wep3 > 0 && wep3 < 36)
    {
        if(ammo > 0 && ammo < 5000)
        {
            format(str, sizeof(str), "An Admin has set you the leader of %s",name);
            SendClientMessage(id,0xFF9900AA, str);
            IsLaw[id] = 1;
            Member[id] = 1;
            Leader[id] = 1;
            IsInOrg[id] = 1;
            GivePlayerWeapon(id,wep1, ammo);
            GivePlayerWeapon(id,wep2, ammo);
            GivePlayerWeapon(id,wep3, ammo);
            format(str,sizeof(str),"myserver/gang/%i.txt",number);
            if(dini_Exists(str))return SendClientMessage(playerid,0xFF0000FF,"Error: That org is already created");
            dini_Create(str);
            dini_IntSet(str,"Ammo",ammo);
            dini_IntSet(str,"Weapon1",wep1);
            dini_IntSet(str,"Weapon2",wep2);
            dini_IntSet(str,"Weapon3",wep3);
            dini_Set(str,"Leader",name);
            dini_Set(str,"Org Name",name);
            return 1;
        }
        else return SendClientMessage(playerid,0xFF0000FF, "Ammo must be between 0 And 5000.");
    }
    else
    {
        SendClientMessage(playerid,0xFF0000FF, "Invalid Weapon ID!");
    }
    return 1;
}
Reply
#6

Ok there girlfirend
Reply
#7

Quote:
Originally Posted by [WF]Demon
Посмотреть сообщение
Tanush i explained to you....

pawn Код:
CMD:createlaw1(playerid, params[])
{
    new str[128],number = 1,wep1,wep2,wep3,id, ammo, name[40];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
    if(sscanf(params,"uiiiis", id,wep1,wep2,wep3,ammo,name)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /createlaw1 [id] [wep1] [wep2] [wep3] [ammo] [name]");
    if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
    if(wep1 > 0 && wep1 < 36)
    if(wep2 > 0 && wep2 < 36)
    if(wep3 > 0 && wep3 < 36)
    {
        if(ammo > 0 && ammo < 5000)
        {
            format(str, sizeof(str), "An Admin has set you the leader of %s",name);
            SendClientMessage(id,0xFF9900AA, str);
            IsLaw[id] = 1;
            Member[id] = 1;
            Leader[id] = 1;
            IsInOrg[id] = 1;
            GivePlayerWeapon(id,wep1, ammo);
            GivePlayerWeapon(id,wep2, ammo);
            GivePlayerWeapon(id,wep3, ammo);
            format(str,sizeof(str),"myserver/gang/%i.txt",number);
            if(dini_Exists(str))return SendClientMessage(playerid,0xFF0000FF,"Error: That org is already created");
            dini_Create(str);
            dini_IntSet(str,"Ammo",ammo);
            dini_IntSet(str,"Weapon1",wep1);
            dini_IntSet(str,"Weapon2",wep2);
            dini_IntSet(str,"Weapon3",wep3);
            dini_Set(str,"Leader",name);
            dini_Set(str,"Org Name",name);
            return 1;
        }
        else return SendClientMessage(playerid,0xFF0000FF, "Ammo must be between 0 And 5000.");
    }
    else
    {
        SendClientMessage(playerid,0xFF0000FF, "Invalid Weapon ID!");
    }
    return 1;
}
That's not going to work the way he wants it to work, think before you post.
Reply
#8

Calg00ne i would say the same to you aswell, What his problem was that the file did not save, So i fixed that problem.

THINK BEFORE YOU POST
Reply
#9

I did think before I posted. Don't get mad for your ignorance.

He wants it to save to his ORGANISATION ID, not an arbitrary number.
Reply
#10

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
I did think before I posted. Don't get mad for your ignorance.

He wants it to save to his ORGANISATION ID, not an arbitrary number.
I'm sorry for this bump BUT Here was what he asked.

Quote:

when i do /createlaw1 the file wont create on myserver/gang/%i.txt

Mmk i have him on xfire, When he tried that code it worked for him, I'm almost 100% sure he could have found out the rest in 2 seconds, So i fixed his problem and Tee suggested something for him, I don't care.


You said it was not saving because you he did not put "id" in the format, Completely not why it wasn't saving, If you even looked at the original code you would see why it was not saving, Anyways, I'm not going to keep this going, If you want to discuss it more, Please, Fuck off.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)