[Pomoc]Komande

Započeo ATL, Novembar 23, 2012, 22:43:48 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

ATL

Skripta koju koristim: CRP
Detaljan opis problema: Znaci kad kucam bilo koju komandu(npr /freeze), kucam ID(0) i opet mi izbaci format kako treba izgledati komanda...
Dio skripte:
if(strcmp(cmd, "/freeze", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /freeze [Playerid/DioImena]");
return 1;
}
new playa;
if(PlayerInfo[playa][pAdmin] >= 0 || PlayerInfo[playa][pGameMaster] >= 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Admini i Game Masteri nemogu biti zaledjeni");
return 1;
}
if (PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[playerid][pGameMaster] < 2)
{
    if(IsPlayerConnected(playa))
    {
        if(playa != INVALID_PLAYER_ID)
        {
            if(PlayerInfo[playerid][pAdminLogin] != 1) return NisiPrijavljen(playerid);
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 0);
format(string, sizeof(string), "AdmCmd: %s je zaledjen od strane %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
else
NisiOvlasten(playerid);
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

Lesa

   if(strcmp(cmd, "/freeze", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /freeze [ID Igraca/Dio Imena]");
            return 1;
         }
         new playa;
         playa = ReturnUser(tmp);
         if(PlayerInfo[playa][pAdmin] > 0)
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Admini ne mogu biti zaledjeni");
            return 1;
         }
         if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
         {
             if(IsPlayerConnected(playa))
             {
                 if(playa != INVALID_PLAYER_ID)
                 {
                    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  TogglePlayerControllable(playa, 0);
                  PlayerFreezed[playa] = 1;
                  GameTextForPlayer(playa, "~r~Frozen", 5000, 3);
                  format(string, sizeof(string), "Freeze: %s je zaledio %s-a",sendername,  giveplayer);
                  printf("%s",string);
                  format(string, sizeof(string), " "COL_RED"%s {FFFFFF}je zaledjen od: "COL_RED"%s",giveplayer ,sendername);
                  ABroadCast(WHITE,string,1);
               }
            }
         }
         else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}({CD3333}Greska{FFFFFF}):Samo Admin-i!");
         }
      }
      else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}({CD3333}Greska{FFFFFF}):Nisi Prijavljen!");
         }
      return 1;
   }

//----------------------------------[unfreeze]------------------------------------------------
   if(strcmp(cmd, "/unfreeze", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /unfreeze [playerid]");
            return 1;
         }
         new playa;
         playa = ReturnUser(tmp);
         if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
         {
             if(IsPlayerConnected(playa))
             {
                 if(playa != INVALID_PLAYER_ID)
                 {
                    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  TogglePlayerControllable(playa, 1);
                  GameTextForPlayer(playa, "~w~Odledjen", 5000, 3);
                  format(string, sizeof(string), "Admin: %s je odledio %s",sendername,  giveplayer);
                  printf("%s",string);
                  format(string, sizeof(string), " "COL_RED"%s {FFFFFF}je odledjen od: "COL_RED"%s",giveplayer ,sendername);
                  ABroadCast(WHITE,string,1);
               }
            }
         }
         else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}({CD3333}Greska{FFFFFF}):Samo Admin-i!");
         }
      }
      else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}({CD3333}Greska{FFFFFF}):Nisi Prijavljen!");
         }
      return 1;
   }

Nema potrebe da stavljas ovo
if(PlayerInfo[playerid][pAdminLogin] != 1) return NisiPrijavljen(playerid);

Sad ti samo promeni to sta ti treba poredjaj po ovakvom redosledu ili definishi :)

if(strcmp(cmd, "/freeze", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /freeze [ID Igraca/Dio Imena]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if(PlayerInfo[playa][pAdmin] > 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Admini ne mogu biti zaledjeni");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
    if(IsPlayerConnected(playa))
    {
        if(playa != INVALID_PLAYER_ID)
        {
if(PlayerInfo[playerid][pAdminLogin] != 1) return NisiPrijavljen(playerid);
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 0);
PlayerFreezed[playa] = 1;
GameTextForPlayer(playa, "~r~Frozen", 5000, 3);
format(string, sizeof(string), "Freeze: %s je zaledio %s-a",sendername,  giveplayer);
printf("%s",string);
format(string, sizeof(string), "AdmCmd: %s je zaledjen od strane %s",giveplayer ,sendername);
ABroadCast(WHITE,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}


Evo stavi ovako komandu i trebalo bi da radi....
Poslednja Izmena: Novembar 24, 2012, 01:52:16 PRE PODNE od Aca SimkE

ATL

Lock, hvala, ali bio je proglem u y_cmd includeu