Oko spawn-pointera za factions

Započeo Skorpija_026, Jul 27, 2021, 10:42:44 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Problem(error/warning): Ovako pravio sam dinamican spawn pointer za organizacije i sada kreiram sve oce da mi sacuva u bazi, i onda se spawnam nece da tacnije spawna me na farmi, a kordinate rade
Deo skripte: [pawn]enum factionse{
   Float:spawn_x[25],
   Float:spawn_y[25],
   Float:spawn_z[25],

   FactionPrefix[30],
   FactionName[30],
   FactionColor[25],

}
new faction_info[factionse];[/pawn]

[pawn]Dialog:spawn_pozicija(playerid, response, listitem, inputtext[]) {
   if(!response) return 1;
   if(response){
      switch(listitem) {
            case 0: {
               new id = fsel_id[playerid];
               new Float:x, Float:y, Float:z;
               GetPlayerPos( playerid, x, y, z );
               faction_info[spawn_x] = x;
               faction_info[spawn_y] = y;
               faction_info[spawn_z] = z;
            new
                szQuery[333];

            mysql_format(SQL, szQuery, sizeof szQuery, "UPDATE `factions` SET `spawn_x`='%f', `spawn_y`='%f', `spawn_z`='%f' WHERE `faction_id`='%i'", x, y, z, id);
            mysql_tquery(SQL, szQuery);

               va_SendClientMessage(playerid, NS_YELLOW, "[INFO] "BELA"Uspesno ste napravili poziciju spawn pointera za organizaciju %s", ImeOrganizacije(id));
            }
         }
    }
    return 1;
}
[/pawn]

za spawn

[pawn]   if(PlayerInfo[playerid][pProveraSpawna] == SPAWN_BAZA)
   {
      if(PlayerInfo[playerid][pLider] == PlayerInfo[ playerid ][ pClan ]) {
         SetPlayerInterior(playerid, 0);
         TogglePlayerControllable(playerid, 0);
         freezee[playerid] =  SetTimerEx("Freeze",3000, false, "i", playerid);
         SetPlayerPos(playerid, faction_info[spawn_x][playerid], faction_info[spawn_y][playerid], faction_info[spawn_z][playerid]);
      }
        else
      {
          PlayerInfo[playerid][pProveraSpawna] = SPAWN_NORMAL;
         new rand = random(sizeof(RandomSpawn));
         SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
         SetPlayerInterior(playerid, 0);
      }
   }[/pawn]

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):[pawn]nema[/pawn]
Poslednja Izmena: Avgust 04, 2021, 20:25:32 POSLE PODNE od M Ө M Σ N Z I
Vandals Project OGC
[size=11.25pt]Vandals Project OGC[/size][/font]
[/color]

Koliko vidim, nisi mu nigdje postavio spawn na

[pawn]PlayerInfo[playerid][pProveraSpawna] == SPAWN_BAZA[/pawn]

I da, pls, nemoj govoriti pointer(a), to je sasvim nesto drugo  :D

Citat: Galardo poslato Jul 27, 2021, 10:49:36 PRE PODNE
Koliko vidim, nisi mu nigdje postavio spawn na

[pawn]PlayerInfo[playerid][pProveraSpawna] == SPAWN_BAZA[/pawn]

I da, pls, nemoj govoriti pointer(a), to je sasvim nesto drugo  :D
nktm jesam postavi imam to gdi mi spawnuje igraca

[pawn]stock Spawnigraca(playerid)
{
   //SetPVarInt(playerid, "Izbegavanje", 1);
    SetPlayerHealth(playerid, 99.0);
    SetTimerEx("PromeniSkin", 5000, false, "i", playerid);
    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
   Update_Skin(playerid, PlayerInfo[playerid][pSkin]);
   if(PlayerInfo[playerid][pProveraSpawna] == SPAWN_BAZA)
   {
      if(PlayerInfo[playerid][pLider] == PlayerInfo[ playerid ][ pClan ]) {
         SetPlayerPos( playerid, faction_info[ id ][ spawnpointer ][ 0 ], faction_info[ id ][ spawnpointer ][ 1 ] , faction_info[ OrgID ][ spawnpointer ][ 2 ] );
         SetPlayerInterior(playerid, 0);
         TogglePlayerControllable(playerid, 0);
         freezee[playerid] =  SetTimerEx("Freeze",3000, false, "i", playerid);
         SetPlayerPos(playerid, faction_info[spawn_x][playerid], faction_info[spawn_y][playerid], faction_info[spawn_z][playerid]);
      }
        else
      {
          PlayerInfo[playerid][pProveraSpawna] = SPAWN_NORMAL;
         new rand = random(sizeof(RandomSpawn));
         SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
         SetPlayerInterior(playerid, 0);
      }
   }
   else if(PlayerInfo[playerid][pProveraSpawna] == SPAWN_NORMALV)
   {
         SetPlayerPos(playerid, 1674.1406,1448.3599,10.7834);
         SetPlayerInterior(playerid, 0);
   }[/pawn]

ps malo sam reworko i opet nece
Vandals Project OGC
[size=11.25pt]Vandals Project OGC[/size][/font]
[/color]

Ne to, vec unutar dialoga, kada odabere spawn na organizaciju, ne postavljas mu vrijednost spawna na SPAWN_BAZA unutar sljedeceg code-a:

[pawn]Dialog:spawn_pozicija(playerid, response, listitem, inputtext[]) {
   if(!response) return 1;
   if(response){
      switch(listitem) {
            case 0: {
               new id = fsel_id[playerid];
               new Float:x, Float:y, Float:z;
               GetPlayerPos( playerid, x, y, z );
               faction_info[spawn_x] = x;
               faction_info[spawn_y] = y;
               faction_info[spawn_z] = z;
            new
                szQuery[333];

            mysql_format(SQL, szQuery, sizeof szQuery, "UPDATE `factions` SET `spawn_x`=`%f`, `spawn_y`=`%f`, `spawn_z`=`%f` WHERE `faction_id`=`%i`", x, y, z, id);
            mysql_tquery(SQL, szQuery);

               va_SendClientMessage(playerid, NS_YELLOW, "[INFO] "BELA"Uspesno ste napravili poziciju spawn pointera za organizaciju %s", ImeOrganizacije(id));
            }
         }
    }
    return 1;
}[/pawn]

Citat: Galardo poslato Jul 27, 2021, 10:55:42 PRE PODNE
Ne to, vec unutar dialoga, kada odabere spawn na organizaciju, ne postavljas mu vrijednost spawna na SPAWN_BAZA unutar sljedeceg code-a:

[pawn]Dialog:spawn_pozicija(playerid, response, listitem, inputtext[]) {
   if(!response) return 1;
   if(response){
      switch(listitem) {
            case 0: {
               new id = fsel_id[playerid];
               new Float:x, Float:y, Float:z;
               GetPlayerPos( playerid, x, y, z );
               faction_info[spawn_x] = x;
               faction_info[spawn_y] = y;
               faction_info[spawn_z] = z;
            new
                szQuery[333];

            mysql_format(SQL, szQuery, sizeof szQuery, "UPDATE `factions` SET `spawn_x`=`%f`, `spawn_y`=`%f`, `spawn_z`=`%f` WHERE `faction_id`=`%i`", x, y, z, id);
            mysql_tquery(SQL, szQuery);

               va_SendClientMessage(playerid, NS_YELLOW, "[INFO] "BELA"Uspesno ste napravili poziciju spawn pointera za organizaciju %s", ImeOrganizacije(id));
            }
         }
    }
    return 1;
}[/pawn]
To ti nije izabralo vec podesavanje dinamicno kordinate za spawn organizacije, nisi ti mene razumeo a eo ti gde bira spawn

[pawn] fDialog(152)
{
   if(!response) return 1;
   switch(listitem)
   {
      case 0:
      {
         PlayerInfo[playerid][pProveraSpawna] = SPAWN_NORMAL;
         SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | Unicate!");
         SavePlayer(playerid);
      }
      case 1:
      {
         if(PlayerInfo[playerid][pPosedovanjeKuce] != -1)
         {
            PlayerInfo[playerid][pProveraSpawna] = SPAWN_KUCA;
            SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | Kuca!");
            SavePlayer(playerid);
         }
         else return SCM(playerid, -1, ""CRVENA"[UG:RPG] "SIVA"Ne posedujete kucu!");
      }
      case 2:
      {
         if(PlayerInfo[playerid][pClan] > 0 || PlayerInfo[playerid][pLider] > 0)
         {
            PlayerInfo[playerid][pProveraSpawna] = SPAWN_BAZA;
            SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | Baza Organizacije!");
            SavePlayer(playerid);
         }
         else return SCM(playerid, -1, ""CRVENA"[UG:RPG] "SIVA"Niste clan organizacije!");
      }
      case 3:
      {
         if(PlayerInfo[playerid][pRent] != -1)
         {
            PlayerInfo[playerid][pProveraSpawna] = SPAWN_RENTKUCA;
            SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | Rentana Kuca!");
            SavePlayer(playerid);
         }
         else return SCM(playerid, -1, ""CRVENA"[UG:RPG] "SIVA"Nemate rentanu kucu!");
      }
      case 4:
      {
         if(PlayerInfo[playerid][pPosedovanjeStana] != -1)
         {
            PlayerInfo[playerid][pProveraSpawna] = SPAWN_STAN;
            SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | Stan!");
            SavePlayer(playerid);
         }
         else return SCM(playerid, -1, ""CRVENA"[UG:RPG] "SIVA"Ne posedujete stan!");
      }
      case 5:
      {
         if(PlayerInfo[playerid][pPosedovanjeVikendice] != -1)
         {
            PlayerInfo[playerid][pProveraSpawna] = SPAWN_VIKENDICA;
            SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | Vikendica!");
            SavePlayer(playerid);
         }
         else return SCM(playerid, -1, ""CRVENA"[UG:RPG] "SIVA"Ne posedujete vikendicu!");
      }
      case 6:
      {
         PlayerInfo[playerid][pProveraSpawna] = SPAWN_NORMALV;
         SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | LV Aerodrom!");
         SavePlayer(playerid);
      }
      case 7:
      {
         PlayerInfo[playerid][pProveraSpawna] = SPAWN_VIPBAZA;
         SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | V.I.P Baza!");
         SavePlayer(playerid);
      }
      case 8:
      {
         if (PlayerInfo[playerid][pSupporter] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
         {
            PlayerInfo[playerid][pProveraSpawna] = SPAWN_STAFFBAZA;
            SCM(playerid,-1,""CRVENA"[UG:RPG] "SIVA"Uspesno ste odabrali spawn | Staff Baza");
            SavePlayer(playerid);
         }
         else return SCM(playerid, -1, ""CRVENA"[UG:RPG] "SIVA"Niste clan staffa!");
      }
   }
   return 1;
}[/pawn]

Radio sam dinamican za organizacije znaci da mogu ingame odrediti, spawn ali nece da odradi ono sto je zelim
Vandals Project OGC
[size=11.25pt]Vandals Project OGC[/size][/font]
[/color]

Fixed. Lock
Vandals Project OGC
[size=11.25pt]Vandals Project OGC[/size][/font]
[/color]