[Pomoc] Nece da mi sprema

Započeo ♥ BMW ♥, Septembar 04, 2012, 21:50:36 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

[quote author=[OG:RP] Mr.Gagi link=topic=52732.msg384270#msg384270 date=1346861445]
1. Sto ti cuvas acc od osobe koja kuca /makeleader zar ne treba osobi kojoj si dao?
2. Uradis ovako:

stock SaveUserAccount(playerid)
{
                new INI:File = INI_Open(UserPath(playerid));
                INI_WriteInt(File,"Lider",PlayerInfo[playerid][pLeader]);
                //Dodaj sve ostalo sto cuvas u acc-u tako da ti odmah sve sacuva jer i ovako moze da ti pravi problem da ne prepravi ono Lider na drugi broj
                INI_Close(File);
return 1;
}

Komanda:
CMD:makeleader(playerid,params[])
{
new string[256];
new idx;
        new level;
new orgid;
new sendername[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
          new giveplayer[MAX_PLAYER_NAME];
    new tmp[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /makeleader [ID Igraca/Dio Imena] [Broj(1-17)]");
SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
SendClientMessage(playerid, 0x33CCFFAA, "1.LSPD || 2. Slobodno || 3. Slobodno || 4. Slobodno ");
SendClientMessage(playerid, 0x33CCFFAA, "5.Slobodno || 6.Slobodno || 7.Slobodno || 8.Slobodno || 9.Slobodno || 10.Slobodno || 12.Slobodno");
SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
tmp = strtok(params, idx);
level = strval(tmp);
if(level > 17 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Nemojte ispod 0, ili preko 17!"); return 1; }
if(!IsPlayerAdmin(playerid))
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "* Postavljen si za lidera bande/mafije | Od strane Admina: {FFFFFF}%s", sendername);
SendClientMessage(para1, SVETLOPLAVA, string);
format(string, sizeof(string), "* Postavio si %s-a da vodi {FFFFFF}| %d.", giveplayer,level);
SendClientMessage(playerid, SVETLOPLAVA, string);
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pChar] = 288; } //LS PD

if(level == 0)
{
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
}
else if(level == 1 || level == 2 || level == 3)
{
    gTeam[para1] = 2;
    PlayerInfo[para1][pTeam] = 2;
}
else if(level == 4)
{
    gTeam[para1] = 1;
    PlayerInfo[para1][pTeam] = 1;
}
else
{
    gTeam[para1] = 15;
    PlayerInfo[para1][pTeam] = 15;
}

    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
    SaveUserAccount(para1);
    if(level == 0)
    {
        PlayerInfo[para1][pRank] = 0;
    }
    else
    {
    PlayerInfo[para1][pRank] = 6;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}| {FFFF9C}TempoBot {FFFFFF}| Niste ovlasteni da koristite tu komandu.");
}
}
return 1;
}

Nisam pogledao sve ali ti TREBA da cuvas para1 to je id igraca
[/quote]
Opet nece :/


Village's Roleplay USKORO...

Village's Roleplay USKORO...

Stari covek

[quote author=[OGRP]Lucky link=topic=52732.msg384286#msg384286 date=1346862604]
[quote author=[OG:RP] Mr.Gagi link=topic=52732.msg384270#msg384270 date=1346861445]
1. Sto ti cuvas acc od osobe koja kuca /makeleader zar ne treba osobi kojoj si dao?
2. Uradis ovako:

stock SaveUserAccount(playerid)
{
                new INI:File = INI_Open(UserPath(playerid));
                INI_WriteInt(File,"Lider",PlayerInfo[playerid][pLeader]);
                //Dodaj sve ostalo sto cuvas u acc-u tako da ti odmah sve sacuva jer i ovako moze da ti pravi problem da ne prepravi ono Lider na drugi broj
                INI_Close(File);
return 1;
}

Komanda:
CMD:makeleader(playerid,params[])
{
new string[256];
new idx;
        new level;
new orgid;
new sendername[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
          new giveplayer[MAX_PLAYER_NAME];
    new tmp[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /makeleader [ID Igraca/Dio Imena] [Broj(1-17)]");
SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
SendClientMessage(playerid, 0x33CCFFAA, "1.LSPD || 2. Slobodno || 3. Slobodno || 4. Slobodno ");
SendClientMessage(playerid, 0x33CCFFAA, "5.Slobodno || 6.Slobodno || 7.Slobodno || 8.Slobodno || 9.Slobodno || 10.Slobodno || 12.Slobodno");
SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
tmp = strtok(params, idx);
level = strval(tmp);
if(level > 17 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Nemojte ispod 0, ili preko 17!"); return 1; }
if(!IsPlayerAdmin(playerid))
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "* Postavljen si za lidera bande/mafije | Od strane Admina: {FFFFFF}%s", sendername);
SendClientMessage(para1, SVETLOPLAVA, string);
format(string, sizeof(string), "* Postavio si %s-a da vodi {FFFFFF}| %d.", giveplayer,level);
SendClientMessage(playerid, SVETLOPLAVA, string);
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pChar] = 288; } //LS PD

if(level == 0)
{
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
}
else if(level == 1 || level == 2 || level == 3)
{
    gTeam[para1] = 2;
    PlayerInfo[para1][pTeam] = 2;
}
else if(level == 4)
{
    gTeam[para1] = 1;
    PlayerInfo[para1][pTeam] = 1;
}
else
{
    gTeam[para1] = 15;
    PlayerInfo[para1][pTeam] = 15;
}

    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
    SaveUserAccount(para1);
    if(level == 0)
    {
        PlayerInfo[para1][pRank] = 0;
    }
    else
    {
    PlayerInfo[para1][pRank] = 6;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}| {FFFF9C}TempoBot {FFFFFF}| Niste ovlasteni da koristite tu komandu.");
}
}
return 1;
}

Nisam pogledao sve ali ti TREBA da cuvas para1 to je id igraca
[/quote]
Opet nece :/
[/quote]
Da si mozda probao, a ne slao meni mod da sredim mozda bi i uradio. Tamo pod SavePlayerAccount dodas ono sve sto cuvas pod OnPlayerDisconnect i ovamo ono i onda treba da radi ako uopste pokusas...

Probaj ovako.
Pod OnPlayerDisconnect dodaj

SpremiIgraca(playerid);

/gmx komanda:
CMD:gmx(playerid, params[])
{
        #pragma unused help
        #pragma unused params
        new string[128];
        if(PlayerInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "MoraÅ¡ biti admin level 5 da bi koristio ovo!");
        format(string,sizeof(string),"RESTART | Admin %s je pokrenuo restart servera.",GetName(playerid));
        SCMToAll(-1,string);
        foreach(Player,i){ SpremiIgraca(i); }
        SendRconCommand("gmx");
        return 1;
}


Ovo stavi bilo gdje

public LoadPlayerInfo(playerid, name[], value[])
{
    INI_Int("Lider", P_Data[playerid][pLeader]);

    return 1;
}


Ovo stavi pod OnDialogResponse(pod tvoj login dialog)
INI_ParseFile(pFile, "LoadPlayerData", .bExtra = true, .extra = playerid);

Negdje na kraj moda

forward SpremiIgraca(playerid);
public SpremiIgraca(playerid)
{
new pFile[35];

    format(pFile, 35, Player_File, GetName(playerid));

    new
    INI:UserFile = INI_Open(pFile);
    INI_WriteInt(UserFile, "Lider", P_Data[playerid][pLeader]);

    INI_Close(UserFile);
}


I gagievu komandu uzmi, probaj tako.
Poslednja Izmena: Septembar 05, 2012, 18:47:10 POSLE PODNE od SpaMaster

[quote author=[OG:RP] Mr.Gagi link=topic=52732.msg384288#msg384288 date=1346862750]
[quote author=[OGRP]Lucky link=topic=52732.msg384286#msg384286 date=1346862604]
[quote author=[OG:RP] Mr.Gagi link=topic=52732.msg384270#msg384270 date=1346861445]
1. Sto ti cuvas acc od osobe koja kuca /makeleader zar ne treba osobi kojoj si dao?
2. Uradis ovako:

stock SaveUserAccount(playerid)
{
                new INI:File = INI_Open(UserPath(playerid));
                INI_WriteInt(File,"Lider",PlayerInfo[playerid][pLeader]);
                //Dodaj sve ostalo sto cuvas u acc-u tako da ti odmah sve sacuva jer i ovako moze da ti pravi problem da ne prepravi ono Lider na drugi broj
                INI_Close(File);
return 1;
}

Komanda:
CMD:makeleader(playerid,params[])
{
new string[256];
new idx;
        new level;
new orgid;
new sendername[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
          new giveplayer[MAX_PLAYER_NAME];
    new tmp[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /makeleader [ID Igraca/Dio Imena] [Broj(1-17)]");
SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
SendClientMessage(playerid, 0x33CCFFAA, "1.LSPD || 2. Slobodno || 3. Slobodno || 4. Slobodno ");
SendClientMessage(playerid, 0x33CCFFAA, "5.Slobodno || 6.Slobodno || 7.Slobodno || 8.Slobodno || 9.Slobodno || 10.Slobodno || 12.Slobodno");
SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
tmp = strtok(params, idx);
level = strval(tmp);
if(level > 17 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Nemojte ispod 0, ili preko 17!"); return 1; }
if(!IsPlayerAdmin(playerid))
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "* Postavljen si za lidera bande/mafije | Od strane Admina: {FFFFFF}%s", sendername);
SendClientMessage(para1, SVETLOPLAVA, string);
format(string, sizeof(string), "* Postavio si %s-a da vodi {FFFFFF}| %d.", giveplayer,level);
SendClientMessage(playerid, SVETLOPLAVA, string);
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pChar] = 288; } //LS PD

if(level == 0)
{
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
}
else if(level == 1 || level == 2 || level == 3)
{
    gTeam[para1] = 2;
    PlayerInfo[para1][pTeam] = 2;
}
else if(level == 4)
{
    gTeam[para1] = 1;
    PlayerInfo[para1][pTeam] = 1;
}
else
{
    gTeam[para1] = 15;
    PlayerInfo[para1][pTeam] = 15;
}

    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
    SaveUserAccount(para1);
    if(level == 0)
    {
        PlayerInfo[para1][pRank] = 0;
    }
    else
    {
    PlayerInfo[para1][pRank] = 6;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}| {FFFF9C}TempoBot {FFFFFF}| Niste ovlasteni da koristite tu komandu.");
}
}
return 1;
}

Nisam pogledao sve ali ti TREBA da cuvas para1 to je id igraca
[/quote]
Opet nece :/
[/quote]
Da si mozda probao, a ne slao meni mod da sredim mozda bi i uradio. Tamo pod SavePlayerAccount dodas ono sve sto cuvas pod OnPlayerDisconnect i ovamo ono i onda treba da radi ako uopste pokusas...
[/quote]
Ovo sto si dao nista ne pomaze tako da...
Citat: вιg вÏ...ηηу poslato Septembar 05, 2012, 18:46:30 POSLE PODNE
Probaj ovako.
Pod OnPlayerDisconnect dodaj

SpremiIgraca(playerid);

/gmx komanda:
CMD:gmx(playerid, params[])
{
        #pragma unused help
        #pragma unused params
        new string[128];
        if(PlayerInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "MoraÅ¡ biti admin level 5 da bi koristio ovo!");
        format(string,sizeof(string),"RESTART | Admin %s je pokrenuo restart servera.",GetName(playerid));
        SCMToAll(-1,string);
        foreach(Player,i){ SpremiIgraca(i); }
        SendRconCommand("gmx");
        return 1;
}


Ovo stavi bilo gdje

public LoadPlayerInfo(playerid, name[], value[])
{
    INI_Int("Lider", P_Data[playerid][pLeader]);

    return 1;
}


Ovo stavi pod OnDialogResponse(pod tvoj login dialog)
INI_ParseFile(pFile, "LoadPlayerData", .bExtra = true, .extra = playerid);

Negdje na kraj moda

forward SpremiIgraca(playerid);
public SpremiIgraca(playerid)
{
new pFile[35];

    format(pFile, 35, Player_File, GetName(playerid));

    new
    INI:UserFile = INI_Open(pFile);
    INI_WriteInt(UserFile, "Lider", P_Data[playerid][pLeader]);

    INI_Close(UserFile);
}


I gagievu komandu uzmi, probaj tako.
Nece ni ovo :///////


Village's Roleplay USKORO...

Village's Roleplay USKORO...

Hahahahaha pa lol gledaj ovo:


public LoadPlayerInfo(playerid, name[], value[])
{
    INI_Int("Lider", P_Data[playerid][pLeader]);

    return 1;
}


i onda parse (loadovanje)


INI_ParseFile(pFile, "LoadPlayerData", .bExtra = true, .extra = playerid);


Razliciti su public i ovo kod loadanja :)

zameni LoadPlayerData sa LoadPlayerInfo pa javi dal radi :P

Kako ovo nismo vidli ??? :S xD

ja tek sad vido kada sam poceo da pisem doktorat o ovome (romane xd)

Poslednja Izmena: Septembar 05, 2012, 22:50:50 POSLE PODNE od dock

CMD:makeleader(playerid,params[])
{
new string[256];
new idx;
        new level;
new orgid;
new sendername[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
          new giveplayer[MAX_PLAYER_NAME];
    new tmp[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /makeleader [ID Igraca/Dio Imena] [Broj(1-17)]");
SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
SendClientMessage(playerid, 0x33CCFFAA, "1.LSPD || 2. Slobodno || 3. Slobodno || 4. Slobodno ");
SendClientMessage(playerid, 0x33CCFFAA, "5.Slobodno || 6.Slobodno || 7.Slobodno || 8.Slobodno || 9.Slobodno || 10.Slobodno || 12.Slobodno");
SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
tmp = strtok(params, idx);
level = strval(tmp);
if(level > 17 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Nemojte ispod 0, ili preko 17!"); return 1; }
if(!IsPlayerAdmin(playerid))
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "* Postavljen si za lidera bande/mafije | Od strane Admina: {FFFFFF}%s", sendername);
SendClientMessage(para1, SVETLOPLAVA, string);
format(string, sizeof(string), "* Postavio si %s-a da vodi {FFFFFF}| %d.", giveplayer,level);
SendClientMessage(playerid, SVETLOPLAVA, string);
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pChar] = 288; } //LS PD

if(level == 0)
{
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
}
else if(level == 1 || level == 2 || level == 3)
{
    gTeam[para1] = 2;
    PlayerInfo[para1][pTeam] = 2;
}
else if(level == 4)
{
    gTeam[para1] = 1;
    PlayerInfo[para1][pTeam] = 1;
}
else
{
    gTeam[para1] = 15;
    PlayerInfo[para1][pTeam] = 15;
}
                                            PlayerInfo[playerid][pLeader] = level;
    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
                                            new INI:File = INI_Open(UserPath(playerid));
                                            INI_WriteInt(File,"Lider",PlayerInfo[playerid][pLeader]);
                                            INI_Close(File);
    if(level == 0)
    {
        PlayerInfo[para1][pRank] = 0;
    }
    else
    {
    PlayerInfo[para1][pRank] = 6;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}| {FFFF9C}TempoBot {FFFFFF}| Niste ovlasteni da koristite tu komandu.");
}
}
return 1;
}
ScripT

Napokon... Moze ovdje LOCK !   8)
Poslednja Izmena: Septembar 06, 2012, 08:47:11 PRE PODNE od [OGRP]Lucky


Village's Roleplay USKORO...

Village's Roleplay USKORO...