[POMOC] Specanje

Započeo William Johnson, Avgust 30, 2011, 13:04:07 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Citat: William Johnson poslato Avgust 30, 2011, 15:59:34 POSLE PODNE
Pa neznam sta tu nevalja o.O

Pogledaj post iznad sta ti je napisao.

Radit ce komanda ako nemas errora.

Znaci,dok imas samo warninge ,radice.

Ali ih popravi.


Server IP: 193.192.58.82:7782
Forum: www.balkan-underline.info


Daj cijelu komandu omg..

Btw. komanda nece radit jer ima return funkciju prije TextDrawShowForPlayer-a, tako da dok dode do njega, samo ce returnat nazad :)
Aequam memento rebus in arduis servare mentem.

evo vam cjela public onplayercommnad

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new specplayerid, specvehicleid, idx;
new IME_TEXTDRAWA;

// WE ONLY DEAL WITH COMMANDS FROM ADMINS IN THIS FILTERSCRIPT
if(!IsPlayerAdmin(playerid)) return 0;

cmd = adminspec_strtok(cmdtext, idx);

// SPECTATE A PLAYER
    if(strcmp(cmd, "/specplayer", true) == 0) {
       new tmp[256];
      tmp = adminspec_strtok(cmdtext, idx);

      if(!strlen(tmp)) {
         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specplayer [playerid]");
         return 1;
      }
      specplayerid = strval(tmp);

      if(!IsPlayerConnected(specplayerid)) {
          SendClientMessage(playerid, COLOR_RED, "specplayer: that player isn't active.");
         return 1;
      }

      TogglePlayerSpectating(playerid, 1);
      PlayerSpectatePlayer(playerid, specplayerid);
      SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
      gSpectateID[playerid] = specplayerid;
      gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
      TextDrawShowForPlayer(playerid, IME_TEXTDRAWA);

       return 1;
   }

// SPECTATE A VEHICLE
if(strcmp(cmd, "/specvehicle", true) == 0) {
    new tmp[256];
tmp = adminspec_strtok(cmdtext, idx);

if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specvehicle [vehicleid]");
return 1;
}
specvehicleid = strval(tmp);

if(specvehicleid < MAX_VEHICLES) {
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, specvehicleid);
gSpectateID[playerid] = specvehicleid;
gSpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
}
return 1;
}

// STOP SPECTATING
if(strcmp(cmd, "/specoff", true) == 0) {
TogglePlayerSpectating(playerid, 0);
gSpectateID[playerid] = INVALID_PLAYER_ID;
gSpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
return 1;
}

return 0;
}

//------------------------------------------------------------------------------------------------------

Pa IME_TEXTDRAWA ti mora biti textdraw, tj. onaj textdraw koji si napravio u OnFilterScriptInit ili u tvom slucaju CreatePlayerInfo, znaci da tvoj textdraw koji ce se showat, tj. njegovo ime mora biti: InfoTextDraw[playerid][0] i InfoTextDraw[playerid][1].. Nemozes samo 'new IME_TEXTDRAWA;' :S. Prejednostavno.
Aequam memento rebus in arduis servare mentem.

Nekuzim :/

ovak ili TextDrawShowForPlayer(playerid, InfoTextDraw[playerid][0], InfoTextDraw[playerid][1]);
Poslednja Izmena: Avgust 30, 2011, 16:51:52 POSLE PODNE od William Johnson

Ne, nego 2 puta TextDrawShowForPlayer, prvi puta je 0 nakraju, drugi puta 1 nakraju :D
Aequam memento rebus in arduis servare mentem.

et uradio :P al opet 3 warninga..


C:\Users\Mario Sokic\Desktop\Balkan Omega Mod 2\filterscripts\spec.pwn(254) : warning 217: loose indentation
C:\Users\Mario Sokic\Desktop\Balkan Omega Mod 2\filterscripts\spec.pwn(264) : warning 217: loose indentation
C:\Users\Mario Sokic\Desktop\Balkan Omega Mod 2\filterscripts\spec.pwn(275) : warning 217: loose indentation
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 

254:tmp = adminspec_strtok(cmdtext, idx);

264:  return 1;

275: return 1;

moras samo poravnati linije...
postaj cijeli do komande akoo neznas sam poravnat..

evo ..

if(!IsPlayerAdmin(playerid)) return 0;

cmd = adminspec_strtok(cmdtext, idx);

// SPECTATE A PLAYER
    if(strcmp(cmd, "/specplayer", true) == 0) {
       new tmp[256];
      tmp = adminspec_strtok(cmdtext, idx);

      if(!strlen(tmp)) {
         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specplayer [playerid]");
         return 1;
      }
      specplayerid = strval(tmp);

      if(!IsPlayerConnected(specplayerid)) {
          SendClientMessage(playerid, COLOR_RED, "specplayer: that player isn't active.");
         return 1;
      }

      TogglePlayerSpectating(playerid, 1);
      PlayerSpectatePlayer(playerid, specplayerid);
      SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
      gSpectateID[playerid] = specplayerid;
      gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
      TextDrawShowForPlayer(playerid, InfoTextDraw[playerid][0]);
      TextDrawShowForPlayer(playerid, InfoTextDraw[playerid][1]);

       return 1;
   }

Evo...
if(!IsPlayerAdmin(playerid)) return 0;

cmd = adminspec_strtok(cmdtext, idx);

// SPECTATE A PLAYER
    if(strcmp(cmd, "/specplayer", true) == 0) {
       new tmp[256];
       tmp = adminspec_strtok(cmdtext, idx);

      if(!strlen(tmp)) {
         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specplayer [playerid]");
         return 1;
      }
      specplayerid = strval(tmp);

      if(!IsPlayerConnected(specplayerid)) {
         SendClientMessage(playerid, COLOR_RED, "specplayer: that player isn't active.");
         return 1;
      }

      TogglePlayerSpectating(playerid, 1);
      PlayerSpectatePlayer(playerid, specplayerid);
      SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
      gSpectateID[playerid] = specplayerid;
      gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
      TextDrawShowForPlayer(playerid, InfoTextDraw[playerid][0]);
      TextDrawShowForPlayer(playerid, InfoTextDraw[playerid][1]);
      return 1;
   }

opet warning na if(!strlen(tmp)) { :S

(256) : warning 217: loose indentation

Probaj sve linije pomaknut u lijevo (do "zida")

probo sam.. izbaci 2 warninga...!
a jbt sad mi izbacuje 3 warninga i po onom  tgovom samo jer sam bio uzmako uz zid :S
edit: uspjeo sam napravit opet na 1 warning ...

C:\Users\Mario Sokic\Desktop\Balkan Omega Mod 2\filterscripts\spec.pwn(256) : warning 217: loose indentation

if(!strlen(tmp)) { je ta linija
Poslednja Izmena: Avgust 30, 2011, 17:24:42 POSLE PODNE od William Johnson

Citat: William Johnson poslato Avgust 30, 2011, 17:20:01 POSLE PODNE
probo sam.. izbaci 2 warninga...!
a jbt sad mi izbacuje 3 warninga i po onom  tgovom samo jer sam bio uzmako uz zid :S
edit: uspjeo sam napravit opet na 1 warning ...

C:\Users\Mario Sokic\Desktop\Balkan Omega Mod 2\filterscripts\spec.pwn(256) : warning 217: loose indentation

if(!strlen(tmp)) { je ta linija

kad neznas poravnavat stavi ovo na vrh skripte

#pragma tabsize 0
stavi ispod define-ova ostalih
Vratio sam se ponovo ocekjute novi server...

Imam to vec unutro..!

Rjesio moze lock
Poslednja Izmena: Avgust 30, 2011, 17:57:00 POSLE PODNE od William Johnson