[HELP] Name -
SonY_ - 22.07.2012
I made the command / all members and / makeleader now ask ourselves the leaders of LSPD's typing / sviclanovi and that my name will not preserve
enum
Код:
#define ORG 12
enum pdInfo
{
Lider1[33],
Lider2[33],
Mesto1[33],
Mesto2[33],
Mesto3[33],
Mesto4[33],
Mesto5[33],
};
new PDInfo[ORG][pdInfo];
Loading LSPD
Код:
stock UcitajPD()
{
new Fajl[64];
for(new idx = 1; idx < sizeof(PDInfo); idx++)
{
format(Fajl, sizeof Fajl, "Organizacije/PoliceDepartment.ini");
if(dini_Exists(Fajl))
{
strmid(PDInfo[idx][Lider1], dini_Get(Fajl,"Lider_1"), 0, strlen(dini_Get(Fajl,"Lider_1")), 255);
strmid(PDInfo[idx][Lider2], dini_Get(Fajl,"Lider_2"), 0, strlen(dini_Get(Fajl,"Lider_2")), 255);
strmid(PDInfo[idx][Mesto1], dini_Get(Fajl,"Mesto_1"), 0, strlen(dini_Get(Fajl,"Mesto_1")), 255);
strmid(PDInfo[idx][Mesto2], dini_Get(Fajl,"Mesto_2"), 0, strlen(dini_Get(Fajl,"Mesto_2")), 255);
strmid(PDInfo[idx][Mesto3], dini_Get(Fajl,"Mesto_3"), 0, strlen(dini_Get(Fajl,"Mesto_3")), 255);
strmid(PDInfo[idx][Mesto4], dini_Get(Fajl,"Mesto_4"), 0, strlen(dini_Get(Fajl,"Mesto_4")), 255);
strmid(PDInfo[idx][Mesto5], dini_Get(Fajl,"Mesto_5"), 0, strlen(dini_Get(Fajl,"Mesto_5")), 255);
printf("*************************");
printf("******* PD Load*******");
}
else
{
printf("ERROR: Neuspelo ucitavanje %s.", Fajl);
}
}
return 1;
}
Save LSPD
Код:
stock SacuvajPD()
{
new Fajl[ 128 ];
format(Fajl, sizeof(Fajl), "Organizacije/PoliceDepartment.ini");
if(fexist(Fajl) )
{
dini_Set(Fajl, "Lider_1", PDInfo[1][Lider1]);
dini_Set(Fajl, "Lider_2", PDInfo[2][Lider2]);
dini_Set(Fajl, "Mesto_1", PDInfo[3][Mesto1]);
dini_Set(Fajl, "Mesto_2", PDInfo[4][Mesto2]);
dini_Set(Fajl, "Mesto_3", PDInfo[5][Mesto3]);
dini_Set(Fajl, "Mesto_4", PDInfo[6][Mesto4]);
dini_Set(Fajl, "Mesto_5", PDInfo[7][Mesto5]);
printf( "[PD] PD sacuvan.");
}
return 1;
}
COMMAND: /makeleader
Код:
CMD:makeleader(playerid, params[])
{
new id, org, string[128], stringa[35];
if(PI[playerid][pAdmin] < 1337) return SCM(playerid, COLOR_GRAD2, "{FFFFFF}[{F81414}BosnaAS{FFFFFF}]{CCCCCC} Admini(+rcon) samo");
else if(sscanf(params, "ui", id, org))return SendClientMessage(playerid, COLOR_CHAT1, "Koristite:{BFC0C2}/makeleader [player id] [id]" );
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "*Pogresan ID Korisnika");
else if(org < 0 || org > 2)return SCM(playerid, COLOR_GRAD2, "LSPD-1,FBI-2....");
//else if(PI[playerid][pLeader] >= 1 ) return SendClientMessage(playerid, 0xDB023EFF, "Nazalost taj igrac je vec lider bande/mafije/org!");
switch(org)
{
case 1:
{
PI[playerid][pLeader] = 1;
PI[playerid][pRank] = 6;
new PlayerName[MAX_PLAYER_NAME];
new ime[MAX_PLAYER_NAME];
imeigraca(playerid, ime);
if(strcmp(PDInfo[playerid][Lider1], "Niko", false)) return SCM(playerid, BELA, "Sve sobe su zauzete");
//OnPlayerUpdate(playerid);
format(string, sizeof(string), "Dodijeljen ti je Lider nad organizacijom: LSPD, HeadAdmin: %s!", ImePrezime(playerid));
SendClientMessage(id, COLOR_LIGHTBLUE, string);
SetPlayerSkin(playerid, 288);
if(!strcmp(PDInfo[playerid][Lider1], "Niko")) strmid(PDInfo[playerid][Lider1], ime, 0, strlen(ime), 255);
else if(!strcmp(PDInfo[playerid][Lider2], "Niko")) strmid(PDInfo[playerid][Lider2], ime, 0, strlen(ime), 255);
SacuvajPD();
format(string, sizeof(string), "Dao si Lidera nad organizacijom: LSPD, Igracu: %s!", ImePrezime(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
return 1;
}
sorry for my bad english
Re: [HELP] Name -
SonY_ - 22.07.2012
HELP PLS
Re: [HELP] Name -
SonY_ - 23.07.2012
****** BUMP ******