Specoff problem

Započeo Bilsen_Jahjagic, Mart 10, 2013, 00:39:16 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Bilsen_Jahjagic

Skripta koju koristim: FS:RP
Detaljan opis problema: Imam problema s komandom specoff
Dio skripte: Kod ove komande CMD:specoff(playerid, params[])
{
TogglePlayerSpectating(playerid, 0);
SetTimerEx("PosAfterSpec",3000,0,"d",playerid);
    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] >= 1)
{
    if(Specing[playerid] != 0)
    {
    Specing[playerid] = 0;
JBC_GivePlayerMoney(playerid,100)
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"Trenutno nikoga ne specujete.");
}
}
  else
  {
SendClientMessage(playerid, COLOR_WHITE, "[GRESKA] Niste ovlasteni da koristite tu komandu !");
}
return 1;
}

Dodao sam specoff dolje ispod ima kod i nakon koristenja ove komande idem u hp pa me onda porta kod burga,nisam mogao naci sta je to sto me porta.Molm vas za pomoc
Neke slike/video za lakse dobivanje pomoci(neobavezno):
forward PosAfterSpec(playerid);
public PosAfterSpec(playerid)
{
JBC_SetPlayerPos(playerid,1195.9919,-929.9071,42.9444);
SetPlayerFacingAngle(playerid,42.9444);
}

Daj mi komandu /spec pa da ti sredim

Bilsen_Jahjagic

CMD:specplayer(playerid, params[])
{
   new Giveplayerid, Name[256], String[256], Name2[256];
    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] >= 1)
   {
   if (sscanf(params, "d", Giveplayerid)) SendClientMessage(playerid,COLOR_WHITE, "Koriscenje: /specplayer [Igracev ID]");
   else if (!IsPlayerConnected(Giveplayerid)) SendClientMessage(playerid,COLOR_PURPLE,"Igrac nije na serveru.");
   else
   {
   if ( Specing[Giveplayerid] == 1 )
   {
   SendClientMessage(playerid, COLOR_RED, "   The person you have tried to spec is spectating someone else.");
   }
   else
   {
    GetPlayerName(playerid, Name, 256);
   GetPlayerName(Giveplayerid, Name2, 256);
   format(String, 256, "[%i] %s is now spectating [%i] %s",playerid, Name,Giveplayerid, Name2);
   CallLocalFunction("ircRemoteSay", "iss", 1, "#FSE", String);
   Specing[playerid] = 1;
   }
   if ( !IsPlayerInAnyVehicle(Giveplayerid) )
   {
   TogglePlayerSpectating(playerid, 1);
   PlayerSpectatePlayer(playerid, Giveplayerid);
   SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
   SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
   return 1;
   }
   else
   {
   TogglePlayerSpectating(playerid, 1);
   PlayerSpectateVehicle(playerid, GetPlayerVehicleID(Giveplayerid));
   SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
   SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
   return 1;
   }
   }
   }
   return 1;
}

CMD:specoff(playerid, params[])
{
   TogglePlayerSpectating(playerid, 0);
   SetTimerEx("PosAfterSpec",3000,0,"d",playerid);
    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] >= 1)
   {
       if(Specing[playerid] != 0)
       {
            Specing[playerid] = 0;
         JBC_GivePlayerMoney(playerid,100)
      }
      else
      {
      SendClientMessage(playerid,COLOR_WHITE,"Trenutno nikoga ne specujete.");
      }
   }
     else
     {
      SendClientMessage(playerid, COLOR_WHITE, "[GRESKA] Niste ovlasteni da koristite tu komandu !");
   }
   return 1;
}

Evo, javi da li radi :)

new
    Float: sZapamtiPoziciju[MAX_PLAYERS][3];




CMD:specplayer(playerid, params[])
{
new Giveplayerid, Name[256], String[256], Name2[256];
        if(AdminDuty[playerid] == 0 || GmDuty[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Morate biti na duznosti!");
    if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGm] >= 1)
    if(sscanf(params, "d", Giveplayerid)) return SendClientMessage(playerid,COLOR_WHITE, "Koriscenje: /specplayer [Igracev ID]");
    if(!IsPlayerConnected(Giveplayerid)) return SendClientMessage(playerid,COLOR_PURPLE,"Igrac nije na serveru.");
if(Specing[Giveplayerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Tog igraca neko vec gleda.");
{
        GetPlayerName(playerid, Name, 256);
    GetPlayerName(Giveplayerid, Name2, 256);
    format(String, 256, "[%i] %s is now spectating [%i] %s",playerid, Name,Giveplayerid, Name2);
    CallLocalFunction("ircRemoteSay", "iss", 1, "#FSE", String);
    Specing[playerid] = 1;
    }
            GetPlayerPos(playerid, sZapamtiPoziciju[playerid][0], sZapamtiPoziciju[playerid][1], sZapamtiPoziciju[playerid][2]);
if(!IsPlayerInAnyVehicle(Giveplayerid))
    {
  TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, Giveplayerid);
    SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
    return 1;
    }
    else
    {
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectateVehicle(playerid, GetPlayerVehicleID(Giveplayerid));
    SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
    return 1;
    }
    return 1;
}




CMD:specoff(playerid, params[])
{
    TogglePlayerSpectating(playerid, 0);
    if(AdminDuty[playerid] == 0 || GmDuty[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Morate biti na duznosti!");
    if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pGm] < 1) return SendClientMessage(playerid, COLOR_WHITE, "[GRESKA] Niste ovlasteni da koristite tu komandu !");
    if(Specing[playerid] == 0) return SendClientMessage(playerid,COLOR_WHITE,"Trenutno nikoga ne specujete.");
    {
Specing[playerid] = 0;
  JBC_GivePlayerMoney(playerid,100);
  SetTimerEx("PosAfterSpec",3000,0,"d",playerid);
    }
return 1;
}




forward PosAfterSpec(playerid);
public PosAfterSpec(playerid)
{
JBC_SetPlayerPos(playerid, sZapamtiPoziciju[playerid][0], sZapamtiPoziciju[playerid][1], sZapamtiPoziciju[playerid][2]);
}




Bilsen_Jahjagic


Probaj ovako, i obrisi taj public PosAfterSpec(playerid), nepotrebno ti je to.

new
    Float: sZapamtiPoziciju[MAX_PLAYERS][3];




CMD:specplayer(playerid, params[])
{
new Giveplayerid, Name[256], String[256], Name2[256];
        if(AdminDuty[playerid] == 0 || GmDuty[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Morate biti na duznosti!");
    if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGm] >= 1)
    if(sscanf(params, "d", Giveplayerid)) return SendClientMessage(playerid,COLOR_WHITE, "Koriscenje: /specplayer [Igracev ID]");
    if(!IsPlayerConnected(Giveplayerid)) return SendClientMessage(playerid,COLOR_PURPLE,"Igrac nije na serveru.");
if(Specing[Giveplayerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Tog igraca neko vec gleda.");
{
        GetPlayerName(playerid, Name, 256);
    GetPlayerName(Giveplayerid, Name2, 256);
    format(String, 256, "[%i] %s is now spectating [%i] %s",playerid, Name,Giveplayerid, Name2);
    CallLocalFunction("ircRemoteSay", "iss", 1, "#FSE", String);
    Specing[playerid] = 1;
    }
if(!IsPlayerInAnyVehicle(Giveplayerid))
    {
  TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, Giveplayerid);
    SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
                        GetPlayerPos(playerid, sZapamtiPoziciju[playerid][0], sZapamtiPoziciju[playerid][1], sZapamtiPoziciju[playerid][2]);
    return 1;
    }
    else
    {
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectateVehicle(playerid, GetPlayerVehicleID(Giveplayerid));
    SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
                        GetPlayerPos(playerid, sZapamtiPoziciju[playerid][0], sZapamtiPoziciju[playerid][1], sZapamtiPoziciju[playerid][2]);
    return 1;
    }
    return 1;
}




CMD:specoff(playerid, params[])
{
    if(AdminDuty[playerid] == 0 || GmDuty[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Morate biti na duznosti!");
    if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pGm] < 1) return SendClientMessage(playerid, COLOR_WHITE, "[GRESKA] Niste ovlasteni da koristite tu komandu !");
    if(Specing[playerid] == 0) return SendClientMessage(playerid,COLOR_WHITE,"Trenutno nikoga ne specujete.");
    {
Specing[playerid] = 0;
  JBC_GivePlayerMoney(playerid, 100);
                JBC_SetPlayerHealth(playerid, 100);
  JBC_SetPlayerPos(playerid, sZapamtiPoziciju[playerid][0], sZapamtiPoziciju[playerid][1], sZapamtiPoziciju[playerid][2]);
                TogglePlayerSpectating(playerid, 0);
    }
return 1;
}




Evo ti komanda /specplayer[id]
Citatdcmd_specplayer(playerid, params[])
{
   new Giveplayerid, Ime[256], String[256], Ime2[256];
   if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameSage] >= 1)
   {
   if (sscanf(params, "d", Giveplayerid)) SendClientMessage(playerid,COLOR_WHITE, "SERVER: /specplayer [Playerid]");
   else if (!IsPlayerConnected(Giveplayerid)) SendClientMessage(playerid,COLOR_PURPLE,"Player not connected?");
   else
   {
   if ( Specing[Giveplayerid] == 1 )
   {
   SendClientMessage(playerid, COLOR_RED, "   The person you have tried to spec is spectating someone else.");
   }
   else
   {
    GetPlayerName(playerid, Ime, 256);
   GetPlayerName(Giveplayerid, Ime2, 256);
   format(String, 256, "[%i] %s is now spectating [%i] %s",playerid, Ime,Giveplayerid, Ime2);
   CallLocalFunction("ircRemoteSay", "iss", 1, "#FSE", String);
   Specing[playerid] = 1;
   }
   if ( !IsPlayerInAnyVehicle(Giveplayerid) )
   {
   TogglePlayerSpectating(playerid, 1);
   PlayerSpectatePlayer(playerid, Giveplayerid);
   SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
   SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
   return 1;
   }
   else
   {
   TogglePlayerSpectating(playerid, 1);
   PlayerSpectateVehicle(playerid, GetPlayerVehicleID(Giveplayerid));
   SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
   SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
   return 1;
   }
   }
   }
   return 1;
}

Evo ti sad komanda /specoff[id]
Citatdcmd_specoff(playerid, params[])
{
   #pragma unused params
   TogglePlayerSpectating(playerid, 0);
   SetTimerEx("PosAfterSpec",3000,0,"d",playerid);
   if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameSage] >= 1)
   {
       if(Specing[playerid] != 0)
       {
            Specing[playerid] = 0;
         GivePlayerMoney(playerid,100)
      }
      else
      {
      SendClientMessage(playerid,COLOR_WHITE,"Trenutno nikoga ne specujete");
      }
   }
     else
     {
      SendClientMessage(playerid, COLOR_WHITE, "Niste ovlasteni da koristite tu komandu !");
   }
   return 1;
}

Zamjeni ove komande sa svojima,ove valjaju
Možete mi dirati sve osim sestre, nju jedino ja smijem maltretirati! :D