Skripta koju koristim: Moja
Detaljan opis problema: Znaci kada kucam /pomoc ili /report ili /sethp ili /adminduty stalno salje duple poruke...
Dio skripte: Dodacu ako treba...
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Evo slika:
(http://www.zaslike.com/files/ujf69xs3dhfuokhp7tu3_thumb.png) (http://www.zaslike.com/viewer.php?file=ujf69xs3dhfuokhp7tu3.png) (http://www.zaslike.com/files/a7wkhdzaxmb929535p03_thumb.png) (http://www.zaslike.com/viewer.php?file=a7wkhdzaxmb929535p03.png)
u kojim cmd to radi ?
Komande su u STRCMP... a izbacuje mi duple poruke na komandama /report, /pomoc, /sethp, /aduty, /givegun
daj ih sve ovde :-X
Komanda /report
if(strcmp(cmd, "/report", true) == 0 || strcmp(cmd, "/re", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(JustReported[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Morate sacekati 2 minuta prije ponovnog slanja reporta ! ");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{FFAF00}Koriscenje: {FFFFFF}(/re)port [ID Igraca/Dio Imena] [text]");
return 1;
}
giveplayerid = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{FFAF00}Koriscenje: {FFFFFF}(/re)port [ID Igraca/Dio Imena] [text]");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "{FFAF00}[Report]: {FFFFFF}Igraca [ID:%d] %s-a je prijavio igrac [ID:%d] %s.", playerid, sendername, giveplayerid, giveplayer);
ABroadCast(0xE19898AA,string,1);
format(string, sizeof(string), "{FFAF00}[Report]: {FFFFFF}%s.", (result));
ABroadCast(0xE19898AA,string,1);
ABroadCast(0xA04C4CAA,"{FFAF00}Koriscenje: {FFFFFF}Da prihvatite report /prihvatireport [ID Igraca] {FFAF00}| {FFFFFF}Da odbijete report /odbijreport [ID Igraca]",1);
SendClientMessage(playerid, 0x96C184AA, "{FFAF00}Vas report je prijmljen i trenutno ga obradjuju admini.");
JustReported[playerid] = 1;
PlayerNeedsHelp[playerid] = 1;
SetTimerEx("ReportReset", 120000, false, "i", playerid);
}
}
}
return 1;
}
Komanda /pomoc
if(strcmp(cmd,"/askq",true)==0 || strcmp(cmd,"/p",true)==0 || strcmp(cmd,"/pomoc",true)==0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{FFAF00}Koriscenje: {FFFFFF}/pomoc [text]");
return 1;
}
if(TimerPomoc[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Morate sacekati 1 minut prije ponovnog slanja pitanja.");
return 1;
}
format(string, sizeof(string), "{FFAF00}Pitanje od %s-a [ID:%d]: {FFFFFF}%s", sendername, playerid,(result));
ABroadCast(COLOR_ASKQ,string,1);
SendClientMessage(playerid, COLOR_ASKQ, "{FFAF00}[DmZ:RP] {FFFFFF}Vase pitanje je poslato Adminima & GameMasterima.");
TimerPomoc[playerid] = 1;
SetTimerEx("TimerP",60000, false, "i", playerid);
}
return 1;
}
Komanda /sethp
if(strcmp(cmd, "/sethp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /sethp [ID Igraca/Dio Imena] [helt]");
return 1;
}
new playa;
new health;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
health = strval(tmp);
if(AdminDuty[playerid] == 1 || GmDuty[playerid] == 1)
{
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Morate biti na duznosti!");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGm] >=3)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
SetPlayerHealth(playa, health);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "Admin %s je namjestio %s-u helt na %d.", sendername,giveplayer,health);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}
Komanda /aduty
if(!strcmp(cmdtext, "/adminduty", true) || !strcmp(cmdtext, "/aduty", true)) // By Ellis
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Morate se prvo prijaviti !");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 0)
{
if(AdminDuty[playerid] == 0)
{
AdminDuty[playerid] = 1;
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid,TEAM_VAGOS_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{F3FF02}Admin {FFFFFF}%s(ID:%d) {F3FF02}je na duznosti, za pomoc kucajte {FFFFFF}/pomoc.", sendername,playerid);
ABroadCast(COLOR_LIGHTRED,string,1);
DutyLabel[playerid] = Create3DTextLabel("{E0A21B}DmZ | Admin na Duznosti!",0xFF000099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0.6);
SetPlayerSkin(playerid, 113);
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
}
else if(AdminDuty[playerid] == 1)
{
Delete3DTextLabel(DutyLabel[playerid]);
AdminDuty[playerid] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{F3FF02}Admin {FFFFFF}%s(ID:%d) {F3FF02}vise nije na duznosti.", sendername,playerid);
new stariskin = PlayerInfo[playerid][pChar];
SetPlayerSkin(playerid, stariskin);
ABroadCast(COLOR_LIGHTRED,string,1);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Niste Admin !");
return 1;
}
}
return 1;
}
Komanda /givegun
if(strcmp(cmd, "/givegun", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /givegun [ID Igraca/Dio Imena] [id oruzija(eg. 46 = Padobran)] [municija]");
return 1;
}
new playa;
new gun;
new ammo;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
gun = strval(tmp);
if(OnDuty[playerid]==1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Koriscenje: /givegun [ID Igraca/Dio Imena] [weaponid] [ammo]");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Koriscenje: /givegun [ID Igraca/Dio Imena] [weaponid] [ammo]");
SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
return 1;
}
if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==39||gun==40||gun==44||gun==45)
{ SendClientMessage(playerid, COLOR_GRAD1, " pogresan ID oruzija!"); return 1; }
tmp = strtok(cmdtext, idx);
ammo = strval(tmp);
if(ammo <1||ammo > 9999)
{ SendClientMessage(playerid, COLOR_GRAD1, "[GRESKA] Nemojte ispod 1 ili preko 9999 metaka!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 1340)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
SafeJBC_GivePlayerWeapon(playa, gun, ammo);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "Admin %s je dao %s-u oruzije %d.", sendername,giveplayer,gun);
ABroadCast(COLOR_YELLOW,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}
Jel ti i ovo 2 puta ispise
Koriscenje: /pomoc [text] .Npr u toj /p komandi.
TO ne...
Aj pogledaj ovo u ostalim admin komandama (onim koje rade)
ABroadCast(COLOR_LIGHTRED,string,1);
Evo pogledao sam i na svakoj admin komandi mi salje duple poruke :S
Ako si na tome kucnom Serveru Admin i GameMaster, onda ti dvaput salje poruku, jer salje GameMasterima i Adminima. Mislim da je do toga
Citat: Lemi_Zero poslato Mart 16, 2012, 11:44:25 PRE PODNE
Evo pogledao sam i na svakoj admin komandi mi salje duple poruke :S
ABroadCast po defaultu salje i adminima i gamemasterima poruku, ovo sto je Kalibar rekao, da proveris da li si i admin i gm na serveru ti moze resiti problem...
OÄito da si GM i admin ..