Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Teodor poslato Maj 05, 2020, 21:36:46 POSLE PODNE

Naslov: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 05, 2020, 21:36:46 POSLE PODNE
Problem(error/warning): zanima me kako da izbacim ovaj Chat, i da mi na tabu bude samo 1 boja
Dio skripte:
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
Slika/video ingame problema(obavezno ako je ingame problem): https://prnt.sc/sbhow7
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Sploxs poslato Maj 05, 2020, 22:06:43 POSLE PODNE
Funkcija SetPlayerColor seta igracevo ime u boju koju hoces.
https://wiki.sa-mp.com/wroot/index.php?title=SetPlayerColor&printable=yes
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 05, 2020, 22:20:55 POSLE PODNE
Citat: Sploxs poslato Maj 05, 2020, 22:06:43 POSLE PODNE
Funkcija SetPlayerColor seta igracevo ime u boju koju hoces.
https://wiki.sa-mp.com/wroot/index.php?title=SetPlayerColor&printable=yes
To, sad imam normalnu boju, ali kako ja da stavim samo 1 chat i to da bude IC chat?
Posto ja imam 2 Chata, defaulth koji je na 15km(lupio sam) i svoj IC
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Shadow. poslato Maj 05, 2020, 22:25:10 POSLE PODNE
[pawn]public OnPlayerText( playerid, text[ ] ) {
   // Tvoj kod za IC chat tude.
   return ( false ); // Return false!
}[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Sploxs poslato Maj 05, 2020, 22:26:16 POSLE PODNE
Posalji OnPlayerText da vidim sta si radio
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 05, 2020, 22:36:19 POSLE PODNE
Citat: ShadowMortar poslato Maj 05, 2020, 22:25:10 POSLE PODNE
[pawn]public OnPlayerText( playerid, text[ ] ) {
   // Tvoj kod za IC chat tude.
   return ( false ); // Return false!
}[/pawn]
TOOO, Radi Care THX, imam jos jedan problem Kako da sklonim ovo dole na mapi?
https://prnt.sc/sbirdk
https://prnt.sc/sbirdk
https://prnt.sc/sbirdk
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Vuzimir poslato Maj 05, 2020, 22:49:47 POSLE PODNE
Pod ongamemodeinit dodaj: [pawn]ShowPlayerMarkers(0);[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 06, 2020, 20:02:43 POSLE PODNE
Imam jedan problem
Ako je igrac u krugu od 10m videce ovu poruku dole, ako je udaljenjiji opet ce videti poruku ali Bez ID< kao da pise u SCMTA, Kako da fixam ovo?(IC chat je u pitanju)
[pawn]
   new id;
   format(string, sizeof(string), "[ID: %d] %s: %s ",id, GetName(playerid), text);
   ProxDetector(10.0, playerid, string, -1);
   return ( false ); // Return false!
[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Vuzimir poslato Maj 06, 2020, 22:04:01 POSLE PODNE
zamjeni new id sa: [pawn]new id = GetPlayerID(playerid);[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 06, 2020, 22:18:15 POSLE PODNE
Citat: Vuzimir poslato Maj 06, 2020, 22:04:01 POSLE PODNE
zamjeni new id sa: [pawn]new id = GetPlayerID(playerid);[/pawn]
error 017: undefined symbol "GetPlayerID"
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Vuzimir poslato Maj 06, 2020, 22:21:34 POSLE PODNE
[pawn]stock GetPlayerID(const Name[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        new pName2[MAX_PLAYER_NAME];
            GetPlayerName(i, pName2, sizeof(pName2));
        if(strcmp(Name, pName2, true)==0)
        {
          return i;
            }
        }
    }
    return -1;
}[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 06, 2020, 22:32:39 POSLE PODNE
Citat: Vuzimir poslato Maj 06, 2020, 22:21:34 POSLE PODNE
[pawn]stock GetPlayerID(const Name[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        new pName2[MAX_PLAYER_NAME];
            GetPlayerName(i, pName2, sizeof(pName2));
        if(strcmp(Name, pName2, true)==0)
        {
          return i;
            }
        }
    }
    return -1;
}[/pawn]
ista linija samo drugi error...
error 035: argument type mismatch (argument 1)
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 06, 2020, 22:34:05 POSLE PODNE
Sve sto sam ubacio :)
[pawn]
   new id = GetPlayerID(playerid);
   format(string, sizeof(string), "[ID: %d] %s: %s ",id, GetName(playerid), text);
   ProxDetector(10.0, playerid, string, -1);
   return ( false ); // Return false!
[/pawn]

[pawn]
stock GetPlayerID(const Name[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        new pName2[MAX_PLAYER_NAME];
        GetPlayerName(i, pName2, sizeof(pName2));
        if(strcmp(Name, pName2, true)==0)
        {
          return i;
            }
        }
    }
    return -1;
}
[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Vuzimir poslato Maj 06, 2020, 22:34:31 POSLE PODNE
Izvini, nisam gledao dobro, obrisi to sve sto sam ti poslao i dodaj sam ovo: [pawn]new id = playerid;[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 06, 2020, 22:40:48 POSLE PODNE
Citat: Vuzimir poslato Maj 06, 2020, 22:34:31 POSLE PODNE
Izvini, nisam gledao dobro, obrisi to sve sto sam ti poslao i dodaj sam ovo: [pawn]new id = playerid;[/pawn]
Nope :(, sve se lepo compile-a, ali opet nece, sad mi cak nece ni IC chat na blizinu samo se koristi onaj kao SCMTA
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Vuzimir poslato Maj 06, 2020, 22:42:43 POSLE PODNE
ajde posalji citav OnPlayerText ovdje
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 06, 2020, 22:44:26 POSLE PODNE
Citat: Vuzimir poslato Maj 06, 2020, 22:42:43 POSLE PODNE
ajde posalji citav OnPlayerText ovdje
[pawn]public OnPlayerText(playerid, text[])
{
   new string[128];
   if(PlayerInfo[playerid][pMute] == 1)
   {
       format(string, 128, "Ne mozes pisati jer si mutiran jos %d minuta", PlayerInfo[playerid][pMute]);
      SCM(playerid,RED, string);
      return 0;
   }
   if(InPubg[playerid] == 1)
   {
       format(string, 128, "[PUBG]%s: %s",GetName(playerid), text);
      SendMessageToPubg(string);
      return 0;
   }
   if((strlen(text) < 3) || (text[0] == '/') || (text[0] == '#') || (text[0] == '!')) return 1;
   new offset;
   new len;
   for(new i=0; i<MAX_WORDS; i++)
   {
      offset = strfind(text, swear, true);
      if(offset > -1)
      {
         len = strlen(swear);
         if(len < 3) break;
         for(new y=0; y<len; y++)
         {
            text[offset+y] = '*';
         }
         swearCount[playerid]++;
         format(string, sizeof(string), "Vrijedanje i psovanje nije dozvoljeno. Upozorenja: %d/15", swearCount[playerid], MAX_SWEARCOUNT);
         SendClientMessage(playerid, 0xE60000FF, string);
            if(swearCount[playerid] >= MAX_SWEARCOUNT)
         {
             new name[24];
             new string2[128];
             GetPlayerName(playerid, name, sizeof(name));
             format(string, sizeof(string), "*** %s je kickovan sa servera zbog vrijedanja/psovanja", name);
             SendMessageToAdmins(string);
             format(string2, sizeof(string2), "Kikovani ste sa servera zato sto ste Vredjali/Psovali u chatu", name);
             SCM(playerid,-1,string2);
             Kick(playerid);
             break;
         }
         break;
      }
   }
   new id = playerid;
   format(string, sizeof(string), "[ID: %d] %s: %s ",id, GetName(playerid), text);
   ProxDetector(10.0, playerid, string, -1);
   return ( false ); // Return false!
}[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Vuzimir poslato Maj 07, 2020, 06:52:34 PRE PODNE
Izgleda u skripti toj ok sve, moze samo biti jos da nesto nije ok sa Prox Decectorom, probaj zamjenuti taj svoj sa ovim: [pawn]forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
                {
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                }
            }
        }
    }
    return 1;
}[/pawn]
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Teodor poslato Maj 07, 2020, 12:40:07 POSLE PODNE
Citat: Vuzimir poslato Maj 07, 2020, 06:52:34 PRE PODNE
Izgleda u skripti toj ok sve, moze samo biti jos da nesto nije ok sa Prox Decectorom, probaj zamjenuti taj svoj sa ovim: [pawn]forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
                {
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                }
            }
        }
    }
    return 1;
}[/pawn]
Opet Isto :(
Naslov: Odg: Uklanjanje obicnog chata?
Poruka od: Vuzimir poslato Maj 07, 2020, 12:49:39 POSLE PODNE
Moraces mi uslikati ili snimiti sta ti je problem.... ne mogu ni ja vise shvatiti sta se desava