[POMOC]WAR

Započeo 3agle, Maj 09, 2014, 10:01:57 PRE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim:Grandlarceny  mod
Detaljan opis problema: Gde stavit Koordinate za spawn u waru (DOCKOV WAR SISTEM[FILTERSCRIPTA]
Slika/Video: //

Evo skripte:

/*

      ex_War made by dock
            DO NOT REMOVE CREDITS
            
         Verzija: 0.1 beta

*/

#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <foreach>

#define COLOR_GREY          0xB4B5B7FF
#define COLOR_RED           0xFF0000AA
#define COLOR_LB            0x00FFFFAA
#define COLOR_LR            0xF05D5DAA

#define COL_GREY            "{B3B5B7}"

#define SEM SendClientMessage(playerid, COLOR_RED, " (WAR) "COL_GREY"Nemate ovlasti da korisite ovu komandu!");
#define ID_INVALID SendClientMessage(playerid, COLOR_RED, " (WAR) "COL_GREY"Igrac nije online!");

#define War_VW 44 // promenite ako vam ne odgovara..

#define func%0(%1) forward%0(%1); \
               public%0(%1)

new WarBrojanje1 = 0;
new WarBrojanje2 = 0;
new WarTim[MAX_PLAYERS] = 0;
new WarZapocet = 0;
new warbrojanje;
new war;

new Float:War1_x,Float:War1_y,Float:War1_z,Float:War1_r,Float:War2_x,Float:War2_y,Float:War2_z,Float:War2_r;

//Mape za war, dodajete ovako:
//      {Tim1_x, Tim1_y, Tim1_z, Tim1_rotacija, Tim2_x, Tim2_y, Tim2_z, Tim2_rotacija}
// ma kraju { } morate imati zarez (ovako: {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},) osim kod zadnjih koordinata..
new Float:WarMape[][8] =
{
   {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}
};

public OnFilterScriptInit()
{
   print("\n--------------------------------------");
   print("             ex_War by loaded");
   print("--------------------------------------\n");
   return 1;
}

public OnFilterScriptExit()
{
   return 1;
}

//Komande

CMD:war(playerid,params[])
{
   if(!Admin(playerid, 2)) return SEM
   new id, tim;
   if(sscanf(params,"ui",id,tim)) return SendClientMessage(playerid, COLOR_GREY, "*Koristi: /war [id igraca] [tim (0-2)]");
   else if(id == INVALID_PLAYER_ID) return ID_INVALID
   WarTim[id] = tim;
   if(WarTim[id] == 0)   { SetPlayerColor(playerid, 0xffffffff); }
   else if(WarTim[id] == 1) { SetPlayerColor(playerid, 0xff0000aa); }
   else if(WarTim[id] == 2) { SetPlayerColor(playerid, 0x0000ffaa); }
   new str[256];
   new ime[MAX_PLAYER_NAME]; GetPlayerName(playerid,ime,sizeof(ime));
   new igrac[MAX_PLAYER_NAME]; GetPlayerName(id,igrac,sizeof(igrac));
   format(str,256," War | Prozvani ste na war od admina %s!", ime);
   SendClientMessage(id, COLOR_LB, str);
   format(str,256," War | Prozvali ste igraca %s na war!", igrac);
   SendClientMessage(playerid, COLOR_LB, str);
   return 1;
}

CMD:warpokreni(playerid,params[])
{
   if(!Admin(playerid,2)) return SEM
   new mapa, vreme;
   if(sscanf(params,"ii",mapa,vreme)) return SendClientMessage(playerid, COLOR_GREY, "*Koristi: /warpokreni [id mape] [vreme (u minutima)]"), SendClientMessage(playerid, COLOR_GREY, "*IDevi mapa: 0) Ime mape");
    War1_x = WarMape[mapa][0]; War1_y = WarMape[mapa][1]; War1_z = WarMape[mapa][2]; War1_r = WarMape[mapa][3];
   War2_x = WarMape[mapa][4]; War2_y = WarMape[mapa][5]; War2_z = WarMape[mapa][6]; War2_r = WarMape[mapa][7];
   war = SetTimer("WarTimer", vreme*60000, false);
   warbrojanje = SetTimer("WarBrojanje", 3000, true);
   foreach(Player,i)
   {
       if(WarTim > 0)
       {
           SpawnPlayer(i);
      }
   }
   WarZapocet = 1;
   return 1;
}

CMD:warzaustavi(playerid,params[])
{
   if(!Admin(playerid,2)) return SEM
   new str[256];
    format(str,256," War | War je zavrsen! TIM 1: %d, TIM 2: %d", WarBrojanje1, WarBrojanje2);
   SendWarMessage(COLOR_RED, str);
   KillTimer(war);
   WarTimer();
   return 1;
}

func WarTimer()
{
   foreach(Player, i)
   {
       if(WarTim > 0)
       {
           if(WarTim == 1)
           {
               new str[256];
               format(str,256," War | War je zavrsen! Vi: %d, Oni: %d", WarBrojanje1, WarBrojanje2);
            SendWarMessage(COLOR_LR, str);
         }
         else if(WarTim == 2)
           {
               new str[256];
               format(str,256," War | War je zavrsen! Vi: %d, Oni: %d", WarBrojanje2, WarBrojanje1);
            SendWarMessage(COLOR_LR, str);
         }
         WarTim = 0;
         WarZapocet = 0;
         SpawnPlayer(i);
         KillTimer(warbrojanje);
      }
   }
   return 1;
}

func WarBrojanje()
{
   foreach(Player, i)
   {
       if(WarTim > 0)
       {
           if(WarTim == 1)
         {
             new str[256];
             format(str,256,"~g~war~n~~p~Vi: ~w~%d~n~~p~Oni: ~w~%d", WarBrojanje1, WarBrojanje2);
             GameTextForPlayer(i, str, 3000, 1);
         }
         else if(WarTim == 2)
         {
             new str[256];
             format(str,256,"~g~war~n~~p~Vi: ~w~%d~n~~p~Oni: ~w~%d", WarBrojanje2, WarBrojanje1);
             GameTextForPlayer(i, str, 3000, 1);
         }
      }
   }
   return 1;
}
   
stock Admin(playerid, level)
{
   if(IsPlayerAdmin(playerid)) return 1;
   if(CallRemoteFunction("GetPlayerWarAdmin", "d", playerid) >= level) return 1;
   return 0;
}

stock SendWarMessage(color,text[])
{
   foreach(Player,i)
   {
       if(WarTim > 0)
       {
           SendClientMessage(i, color, text);
      }
   }
   return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
   return 1;
}

public OnPlayerConnect(playerid)
{
   return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
   return 1;
}

public OnPlayerSpawn(playerid)
{
    if(WarTim[playerid] == 0)   { SetPlayerColor(playerid, 0xffffffff); }
   else if(WarTim[playerid] == 1) { SetPlayerColor(playerid, 0xff0000aa); }
   else if(WarTim[playerid] == 2) { SetPlayerColor(playerid, 0x0000ffaa); }
   if(WarZapocet == 1)
   {
       if(WarTim[playerid] == 1)
       {
           SetPlayerVirtualWorld(playerid, War_VW);
           SetPlayerPos(playerid, War1_x, War1_y, War1_z);
           SetPlayerFacingAngle(playerid, War1_r);
           GivePlayerWeapon(playerid, 9, 1);// dodajte jos oruzja ako vam je volja :D
           GivePlayerWeapon(playerid, 16, 2);
           GivePlayerWeapon(playerid, 22, 500);
           GivePlayerWeapon(playerid, 29, 500);
           GivePlayerWeapon(playerid, 31, 500);
           GivePlayerWeapon(playerid, 33, 100);
           SetPlayerHealth(playerid, 100);
         return 1;
      }
      else if(WarTim[playerid] == 2)
       {
           SetPlayerVirtualWorld(playerid, War_VW);
           SetPlayerPos(playerid, War2_x, War2_y, War2_z);
           SetPlayerFacingAngle(playerid, War2_r);
            GivePlayerWeapon(playerid, 9, 1);// dodajte jos oruzja ako vam je volja :D
           GivePlayerWeapon(playerid, 16, 2);
           GivePlayerWeapon(playerid, 22, 500);
           GivePlayerWeapon(playerid, 29, 500);
           GivePlayerWeapon(playerid, 31, 500);
           GivePlayerWeapon(playerid, 33, 100);
           SetPlayerHealth(playerid, 100);
         return 1;
      }
   }
   return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
   new ime[MAX_PLAYER_NAME]; GetPlayerName(killerid, ime, sizeof(ime));
   new igrac[MAX_PLAYER_NAME]; GetPlayerName(playerid, igrac, sizeof(igrac));
   if(WarZapocet == 1)
   {
      if(WarTim[killerid] == 1)
      {
          if(WarTim[playerid] == 1)
          {
              WarBrojanje2++;
              SendClientMessage(playerid, COLOR_RED, "*Protivnici su dobili bod jer ste TKali!");
         }
         else
         {
             WarBrojanje1++;
             new str[256];
             format(str,256," (War) Igrac %s je ubio %s", ime, igrac);
             SendWarMessage(COLOR_LR, str);
         }
      }
      if(WarTim[killerid] == 2)
      {
          if(WarTim[playerid] == 2)
          {
              WarBrojanje1++;
              SendClientMessage(playerid, COLOR_RED, "*Protivnici su dobili bod jer ste TKali!");
         }
         else
         {
             WarBrojanje2++;
             new str[256];
             format(str,256," (War) Igrac %s je ubio %s", ime, igrac);
             SendWarMessage(COLOR_LR, str);
         }
      }
   }
   return 1;
}

public OnVehicleSpawn(vehicleid)
{
   return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
   return 1;
}

public OnPlayerText(playerid, text[])
{
   return 1;
}

/*public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp("/mycommand", cmdtext, true, 10) == 0)
   {
      // Do something here
      return 1;
   }
   return 0;
}*/

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
   return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
   return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
   return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
   return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
   return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
   return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
   return 1;
}

public OnRconCommand(cmd[])
{
   return 1;
}

public OnPlayerRequestSpawn(playerid)
{
   return 1;
}

public OnObjectMoved(objectid)
{
   return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
   return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
   return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
   return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
   return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
   return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
   return 1;
}

public OnPlayerExitedMenu(playerid)
{
   return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
   return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
   return 1;
}

public OnPlayerUpdate(playerid)
{
   return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
   return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
   return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
   return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
   return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
   return 1;
}

// ================== < [ CREDITS DOCK ] > ================== //








I AKO MOZE DA MI NEKO ODMA UBACI KOORDINATE:

AddPlayerClass(113,-87.3015,-118.6121,3.1094,1.3635,0,0,0,0,0,0); // spawn
AddPlayerClass(113,-138.7047,-111.2664,3.1172,356.8254,0,0,0,0,0,0); // spawn
AddPlayerClass(113,-134.7286,-94.1811,3.1181,347.1302,0,0,0,0,0,0); // spawn
AddPlayerClass(113,-86.4041,-104.5740,3.1181,345.8926,0,0,0,0,0,0); // spawn
AddPlayerClass(113,-8.9838,94.6115,3.1172,159.4040,0,0,0,0,0,0); // spawn
AddPlayerClass(113,-57.1103,122.1759,3.1172,162.0856,0,0,0,0,0,0); // spawn
AddPlayerClass(113,-21.5365,124.6578,3.1096,165.4280,0,0,0,0,0,0); // spawn
AddPlayerClass(113,-57.1616,161.8174,3.0185,156.5579,0,0,0,0,0,0); // spaw





//Mape za war, dodajete ovako:
//      {Tim1_x, Tim1_y, Tim1_z, Tim1_rotacija, Tim2_x, Tim2_y, Tim2_z, Tim2_rotacija}
// ma kraju { } morate imati zarez (ovako: {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},) osim kod zadnjih koordinata..
new Float:WarMape[][8] =
{
   {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}
};

//Mape za war, dodajete ovako:
//      {Tim1_x, Tim1_y, Tim1_z, Tim1_rotacija, Tim2_x, Tim2_y, Tim2_z, Tim2_rotacija}
// ma kraju { } morate imati zarez (ovako: {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},) osim kod zadnjih koordinata..
new Float:WarMape[][8] =
{
   {-87.3015,-118.6121,3.1094,1.3635, 138.7047,-111.2664,3.1172,356.8254}
};


Hajde pokusaj ovako, ako sam dobro skontao njegovo objasnjenje...
Jednostavno Tuxa'


Citat: CH|pr0 poslato Maj 11, 2014, 13:39:17 POSLE PODNE
Tuxa,Ne radi spawn,tj krivo si ubacio ove koordinate..Probao sam ,spawna me u Las Colinas i drugdje..

Pa stavi si tamo di želiš da te spawna ?

PA iso sam  /save spawn kod Farme one ..I koordinate sam poslo ,udjem opet spawna isto lol ..De probaj opet