[POMOC] Kako iskljuciti default SA:MP chat

Započeo Denis_Lapi
12. Jan. 2014. Zaključano
1,146
pregleda
12
postova
denis_lapi
5
Godfather
12. Jan. 2014.
Skripta koju koristim: Moja skripta
Detaljan opis problema:Zanima me na koji nacin mogu da iskljucim onaj default SA:MP chat (onaj narandzasti koji je ubacen kad se skine PAWNO paket) i naravno kako da napravim neki svoj, kao i na svakom drugom serveru da vise samo igraci koji su u mojoj blizini tj. blizini igraca..Primer:     
Denis_Lapi kaze: Kako da napravi chat
Tako nesto bih hteo, mislim da razumete sta hocu, znaci klasican chat
Dio skripte:  //
Neke slike/video za lakse dobivanje pomoci(neobavezno):
James_SmithXDl
6
OG Legend
12. Jan. 2014.
ovo pod onplayertext
new string;
    format(string, sizeof(string), "%s kaze: %s", GetName(playerid), text);
    ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
ermin.a
5
Underboss
12. Jan. 2014.
Uradi ovako kao sto ti C++ rekao samo OnPlayerText callback stavi da return 0 (false), tj da ne salje nikakav text (osim formatiranog koristeci ProxDetector)
denis_lapi
5
Godfather
13. Jan. 2014.
: error 017: undefined symbol "GetName"
: error 017: undefined symbol "ProxDetector"


Baca error, do sada nisam koristio ProxDetector
James_SmithXDl
6
OG Legend
13. Jan. 2014.
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;
}
stock GetName(playerid)
{
    new name;
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
ermin.a
5
Underboss
13. Jan. 2014.
stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
new Float:posx, Float:posy, Float:posz, Float:oldposx, Float:oldposy, Float:oldposz, Float:tempposx, Float:tempposy, Float:tempposz, invehicle, virtualworld = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid), vehicleid = GetPlayerVehicleID(playerid), ivehicleid;
if(vehicleid) { GetVehiclePos(vehicleid,oldposx,oldposy,oldposz); }
    else
{
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    vehicleid = GetPlayerVehicleID(playerid);
}
foreach(Player, i) {
    if(GetPlayerVirtualWorld(i) == virtualworld) {
if((GetPlayerInterior(i) == interior)) {
if(vehicleid) {
if(IsPlayerInVehicle(i,vehicleid)) invehicle = 1; }
if(!invehicle) {
if(IsPlayerInAnyVehicle(i)) {
ivehicleid = GetPlayerVehicleID(i);
GetVehiclePos(ivehicleid,posx,posy,posz); }
else {
GetPlayerPos(i,posx,posy,posz); }
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) SCM(i, col1, string);
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) SCM(i, col2, string);
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) SCM(i, col3, string);
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) SCM(i, col4, string);
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) SCM(i, col5, string);
}
else SCM(i, col1, string);
}
}
}
return 1;
}

stock RPname(playerid)
{
new Name[ MAX_PLAYER_NAME ], i = -1;
GetPlayerName( playerid, Name, MAX_PLAYER_NAME );
while( Name[ ++i ] )
if( Name[ i ] == '_' )
Name[ i ] = ' ';
return Name;
}
denis_lapi
5
Godfather
13. Jan. 2014.
Baca mi neki warning-e, mislim nije to nista strasno, ali kad vec radim mod od 0 bilo bi lepo da ih nema
C:\Users\Novica\Desktop\Mod 0\gamemodes\MojMod.pwn(2562) : warning 202: number of arguments does not match definition
C:\Users\Novica\Desktop\Mod 0\gamemodes\MojMod.pwn(2562) : warning 202: number of arguments does not match definition
C:\Users\Novica\Desktop\Mod 0\gamemodes\MojMod.pwn(2565) : warning 217: loose indentation


Uzgred, jel moze neko da mi objasni za sta sluzi ProxDetector, onako malo detaljnije

Imam problem, sad sam video...

http://postimg.org/image/5x3vn1oc9/
ermin.a
5
Underboss
13. Jan. 2014.
Pa salje poruku u 5 razlicitih boja zavisno od udaljenosti.
Pogledaj malo funkciju pa ces skontat,valjda 😄

btw warning 202:  ne poklapa ti se broj parametara sa prototipom, npr SetPlayerInterior(playerid, 13, 245); // ovde ti 245 ne treba itd.

warning 217: neporavnane linije, gubis identaciju i compiler ne moze da prepozna kod ali nista strasno
denis_lapi
5
Godfather
13. Jan. 2014.
http://postimg.org/image/5x3vn1oc9/ Do ega moze ovo biti, to me interesuje.. ?
Mnogo mi je histno da ti saznam, ne mogu da nastavim rad skripte ako to ne sredim
denis_lapi
5
Godfather
14. Jan. 2014.
Jel b neko mogao da pomogne oko ovog problema, stvarno ne znam o cemu se radi, ali daje ovaj glupi font

http://postimg.org/image/5x3vn1oc9/
ermin.a
5
Underboss
14. Jan. 2014.
Kako si formatirao string koji saljes?
denis_lapi
5
Godfather
14. Jan. 2014.
Sve sam uradio, kao sto si mi gore rekao, nista nisam menjao osim SCM ==> SendClientMessage

Ajde mi daj kompet kako treba da se odradi, ako mozes..Imam jos par problema a to je ovaj:

new igrac, string;

format(string,sizeof(string),"%s je poceo vuci igraca %s-u.",GetPlayerName(playerid),GetPlayerName(igrac));

(4786) : warning 202: number of arguments does not match definition

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha