[POMOC] Nekoliko komandi

Započeo [SC] ScHaLe, Jul 27, 2011, 19:21:00 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: BMW Edit
Detaljan opis problema: Trebala bi mi mala pomoc oko sljedecih komandi.. /kick i /ban da se nemogu admini meÄ'usobno kickat/banat...Onda bi mi trebao /warn i /unwarn sistem.Nesto slicna komandi /warn a to je /great dakle da igrace moze sakupit recimo 5 pohvali i makne mu se warn ili dobije nes para.. I na kraju treba mi komanda za skidanje lidera, ako idem Makeleader [ID] 0..nitko vise me ne moze /invite jer pise da sam u ORG..
Dio skripte:
Evo za ban if(strcmp(cmd, "/ban", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
            new playersip[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /ban [ID/DioImena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2 || IsPlayerAdmin(playerid))
{
    if(IsPlayerConnected(giveplayerid))
    {
        if(giveplayerid != INVALID_PLAYER_ID)
        {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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, "Koristi: /ban [ID/DioImena] [razlog]");
return 1;
}
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Nemozes banati veci adm lvl od sebe!");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string), "%s je dobio ban od %s.Razlog: %s" , giveplayer,sendername, (result));
BanLog(string);
format(string, sizeof(string), "SERVER: %s je dobio ban od %s.Razlog: %s.", giveplayer,  sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
format(string, sizeof(string), "[BAN LOG]: %s je pridodan u listu bananih od strane administratora %s", playersip, sendername);
SendAdminMessage(COLOR_YELLOW, string);
SendClientMessage(giveplayerid,COLOR_LIGHTRED,"---------------------------------------------[BAN]------------------------------------------------------------------------------------------------------------");
format(string, sizeof(string), "SERVER: Dobili ste ban od administratora %s", sendername);
SendClientMessage(giveplayerid,COLOR_WHITE, string);
format(string, sizeof(string), "RAZLOG: %s.", (result));
SendClientMessage(giveplayerid,COLOR_WHITE, string);
SendClientMessage(giveplayerid,COLOR_WHITE, "SERVER: Ako mislite da je doslo do greske obratite se na forumu.");
SendClientMessage(giveplayerid,COLOR_WHITE, "SERVER: Vas Virje Gamer's Admin Team");
SendClientMessage(giveplayerid,COLOR_LIGHTRED,"--------------------------------------------------------------------------------------------------------------------------------------------------------------");
      Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "** %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}

Evo za kick:if(strcmp(cmd, "/kick", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
      tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /kick [ID/DioImena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
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_DGOLD, "KORISTENJE: /kick [playerid/DioImena] [reason]");
return 1;
}

format(string, sizeof(string), "SERVER: %s je dobio kick od %s. Razlog: %s.", giveplayer, sendername, (result));
KickLog(string);
format(string, sizeof(string), "SERVER: %s je dobio kick od %s. Razlog: %s.", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "----------------------------------------------[KICK]-------------------------------------------");
format(string, sizeof(string), "SERVER:Dobili ste kick sa servera od strane administratora %s", sendername );
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "RAZLOG: %s." , (result));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid, COLOR_WHITE,"Ako mislite da je doslo do greske - obratite se na forumu.");
SendClientMessage(giveplayerid, COLOR_WHITE,"Vas Virje Gamer's Admin Team");
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "------------------------------------------------------------------------------------------------");
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}

Evo za /makeleader:if(strcmp(cmd, "/makeleader", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DGOLD, "Koristite: /makeleader [ID/Dio imena] [Broj 1-PD, 6-LCN, 8-H, 13-B, 12-SR, 15-GSF, 16-CNN]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 16 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "   Ne idite ispod 0, ili iznad 16!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
            if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Taj igrac je u Faction / Family !");
                return 1;
            }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "   Vi ste postavljeni za lidera od Administratora %s", sendername);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), "   Vi ste dali %s broj organizacije %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_WHITE, 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; } //Police Force
else if(level == 2) { PlayerInfo[para1][pChar] = 286; } //FBI/ATF
else if(level == 3) { PlayerInfo[para1][pChar] = 287; } //National Guard
else if(level == 4) { PlayerInfo[para1][pChar] = 228; } //Fire/Ambulance
else if(level == 5) { PlayerInfo[para1][pChar] = 115; } //Crips
else if(level == 6) { PlayerInfo[para1][pChar] = 113; } //La Cosa Nostra
else if(level == 7) { PlayerInfo[para1][pChar] = 147; } //Mayor
else if(level == 8) { PlayerInfo[para1][pChar] = 294; } //Hitmans
else if(level == 9) { PlayerInfo[para1][pChar] = 227; } //RTS Studio
else if(level == 10) { PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company
else if(level == 11) { PlayerInfo[para1][pChar] = 121; } //Corleone
else if(level == 12) { PlayerInfo[para1][pChar] = 115; } //Hells Angels
else if(level == 13) { PlayerInfo[para1][pChar] = 104; } //Ballas
else if(level == 15) { PlayerInfo[para1][pChar] = 271; } //GroveStreet Families
else if(level == 16) { PlayerInfo[para1][pChar] = 110; } // Los Antos Vagos

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]);

    if(level == 0)
    {
        PlayerInfo[para1][pRank] = 0;
    }
    else
    {
    PlayerInfo[para1][pRank] = 6;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste autorizovani da bi ste Koristiteli ovu komandu!");
}
}
return 1;
}

Evo i za /invite mozda ce trebat:if(strcmp(cmd, "/invite", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristite: /invite [playerid/PartOfName]");
return 1;
}
new para1;
new ftext[20];
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
    if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
    {
        if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Force"; ChosenSkin[para1] = 71; SetPlayerSkin(para1, 71); }
        else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI/ATF"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
        else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "National Guard"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
        else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Firemen/Ambulance"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
        else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Crips"; ChosenSkin[para1] = 116; SetPlayerSkin(para1, 116); }
        else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "La Cosa Nostra"; ChosenSkin[para1] = 125; SetPlayerSkin(para1, 125); }
        else if(PlayerInfo[playerid][pLeader] == 7) { return 1; }
        else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ftext = "Hitman Agency"; ChosenSkin[para1] = 249; SetPlayerSkin(para1, 249); }
        else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "ABC Studio"; ChosenSkin[para1] = 148; SetPlayerSkin(para1, 148); }
        else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi Cab Company"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Corleone"; ChosenSkin[para1] = 123; SetPlayerSkin(para1, 123); }
else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Hels Angels"; ChosenSkin[para1] = 247; SetPlayerSkin(para1, 247); }
else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Ballas"; ChosenSkin[para1] = 102; SetPlayerSkin(para1, 102); }
        else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "GroveStreet"; ChosenSkin[para1] = 293; SetPlayerSkin(para1, 293); }
        else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Los Antos Vagos"; ChosenSkin[para1] = 108; SetPlayerSkin(para1, 108); }
else { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
PlayerInfo[para1][pRank] = 1;
printf("AdmWarn: %s je ubacio %s u %s.", sendername, giveplayer, ftext);
format(string, sizeof(string), "   Pridruzili ste se %s, Ubacen si od strane lidera %s", ftext, sendername);
SendClientMessage(para1, COLOR_LIGHTRED, string);
format(string, sizeof(string), "   Ubacili ste igraca %s u vasu organizaciju %s.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "  Taj igrac je trenutno trazen/ ili u drugom timu / ili vec clan neke porodice.");
    return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste autorizovani da bi ste Koristiteli ovu komandu (lideri samo)!");
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Street's Creed

Street's Creed gaming zajednica se vraća.
Forum: www.streets-creed.info
IP: 213.149.60.34:7774