[Pomoc] IC i OOC chat.

2. Feb. 2013. Zaključano
1,398
pregleda
17
postova
Alen-Mata
4
Shot Caller
2. Feb. 2013.
Skripta koju koristim: Radius RolePlay
Detaljan opis problema: Kako da ubacim IC i OOC chat,da mi nebude onim zutim slovima.Imate vise na slici.Znaci koristim YCMD.
Dio skripte: /
Neke slike/video za lakse dobivanje pomoci(neobavezno)http://www.zaslike.com/viewer.php?file=gswphk76nnpfubh6hyei.png
Alen-Mata
4
Shot Caller
2. Feb. 2013.
Izbacuje i fatal erore kad zaljepim.I vidim da to nije YCMD.
Johnâ„¢
5
Godfather
2. Feb. 2013.
Za IC chat dodaš ovo pod OnPlayerText callback:

public OnPlayerText(playerid, text[])
{
new
message[128+1], pName[MAX_PLAYER_NAME+1];

    GetPlayerName(playerid, pName, sizeof(pName));

    format(message, sizeof(message), "%s: %s", pName, text);
sendICMessage(20.0, playerid, message);
return 0;
}


I ovu funkciju na kraj moda:

stock sendICMessage(Float:dist, playerid, message[]) // By SA:MP team, edited by Joey_
{
    new
pName[MAX_PLAYER_NAME+1],
finalMsg[256+1];

if (!strlen(message)) return;

new
Float:fPlayerX, Float:fPlayerY, Float:fPlayerZ,
Float:fPlayerToPlayerDist;
Float:fNormDistance,
ColorScale,
ColorValue;

GetPlayerName(playerid, pName, sizeof(pName));

format(finalMsg, sizeof(finalMsg), "%s: %s", pName, message);

SendClientMessage(playerid, 0xD0D0D0FF, finalMsg);

GetPlayerPos(playerid, fPlayerX, fPlayerY, fPlayerZ);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && (i != playerid) && IsPlayerStreamedIn(playerid, i))
{
fPlayerToPlayerDist = GetPlayerDistanceFromPoint(i, fPlayerX, fPlayerY, fPlayerZ);

if (fPlayerToPlayerDist < dist)
{
fNormDistance = 1.0 - (fPlayerToPlayerDist / dist);

if(fNormDistance > 0.75) ColorScale = 220;
else ColorScale = floatround(96.0 + (128.0 * fNormDistance));

ColorValue = 0x000000FF | ColorScale << 24 | ColorScale << 16 | ColorScale << 8;
SendClientMessage(i, ColorValue, finalMsg);
}
}
}
}


A za OOC chat dodaš ovu komandu u svoj mod:
YCMD:ooc(playerid, params[], help)
{
new
message, finalMessage[128+1], pName[MAX_PLAYER_NAME+1];

if (sscanf(params, "s", message)) return SendClientMessage(playerid, -1, "Koristi: /ooc ");

GetPlayerName(playerid, pName, sizeof(pName));

format(finalMessage, sizeof(finalMessage), "(( %s: %s ))", pName, finalMessage);
SendClientMessageToAll(0xD0D0D0FF, finalMessage);
return 1;
}
Alen-Mata
4
Shot Caller
2. Feb. 2013.
Ovo
stock sendICMessage(Float:dist, playerid, message[]) // By SA:MP team, edited by Joey_
{
    new
pName[MAX_PLAYER_NAME+1],
finalMsg[256+1];

if (!strlen(message)) return;

new
Float:fPlayerX, Float:fPlayerY, Float:fPlayerZ,
Float:fPlayerToPlayerDist;
Float:fNormDistance,
ColorScale,
ColorValue;

GetPlayerName(playerid, pName, sizeof(pName));

format(finalMsg, sizeof(finalMsg), "%s: %s", pName, message);

SendClientMessage(playerid, 0xD0D0D0FF, finalMsg);

GetPlayerPos(playerid, fPlayerX, fPlayerY, fPlayerZ);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && (i != playerid) && IsPlayerStreamedIn(playerid, i))
{
fPlayerToPlayerDist = GetPlayerDistanceFromPoint(i, fPlayerX, fPlayerY, fPlayerZ);

if (fPlayerToPlayerDist < dist)
{
fNormDistance = 1.0 - (fPlayerToPlayerDist / dist);

if(fNormDistance > 0.75) ColorScale = 220;
else ColorScale = floatround(96.0 + (128.0 * fNormDistance));

ColorValue = 0x000000FF | ColorScale << 24 | ColorScale << 16 | ColorScale << 8;
SendClientMessage(i, ColorValue, finalMsg);
}
}
}
}

stavim na kraj moda,i onda bude i fatal erora i sveg.I OOC chat stavim i kucam /ooc i napisem '' a '',a ono izbacuje /ooc
Nevalja ti--
Ovo prvo OnPlayerText valja , to sam ustimo.
Johnâ„¢
5
Godfather
2. Feb. 2013.
Tu funkciju zamijeni ovom:

stock sendICMessage(Float:dist, playerid, message[]) // By SA:MP team, edited by Joey_
{
    new
pName[MAX_PLAYER_NAME+1],
finalMsg[256+1];

if (!strlen(message)) return;

new
Float:fPlayerX, Float:fPlayerY, Float:fPlayerZ,
Float:fPlayerToPlayerDist,
Float:fNormDistance,
ColorScale,
ColorValue;

GetPlayerName(playerid, pName, sizeof(pName));

format(finalMsg, sizeof(finalMsg), "%s: %s", pName, message);

SendClientMessage(playerid, 0xD0D0D0FF, finalMsg);

GetPlayerPos(playerid, fPlayerX, fPlayerY, fPlayerZ);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && (i != playerid) && IsPlayerStreamedIn(playerid, i))
{
fPlayerToPlayerDist = GetPlayerDistanceFromPoint(i, fPlayerX, fPlayerY, fPlayerZ);

if (fPlayerToPlayerDist < dist)
{
fNormDistance = 1.0 - (fPlayerToPlayerDist / dist);

if(fNormDistance > 0.75) ColorScale = 220;
else ColorScale = floatround(96.0 + (128.0 * fNormDistance));

ColorValue = 0x000000FF | ColorScale << 24 | ColorScale << 16 | ColorScale << 8;
SendClientMessage(i, ColorValue, finalMsg);
}
}
}
}


Što se tiče /ooc komande, to je komanda i moraš ju koristit ovako koristit ako hoćeš da ti ispiše tekst: /ooc a
gLava
5
Crime Lord
2. Feb. 2013.
Sad bi trebalo da radi ...
--Lood--
5
Crime Lord
2. Feb. 2013.
evo brt znaci pod onplayertext posto verovatno imas proxdetector
public OnPlayerText(playerid, text[])
{
new str;
new ime;
GetPlayerName(playerid, pname, 24);
format(str, sizeof(str), "{FFFFFF}%s: %s", pname, text);
ProxDetector(5.0, playerid, str,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF);
return 0;
}
Blaeks_Biofor
5
Forum Don
3. Feb. 2013.
ja ti kao i lood preporucujem da koristis proxdetector + ycmd u takvim komandama
Alen-Mata
4
Shot Caller
3. Feb. 2013.
Joey - slika sto izbaci kad stavim taj stock - http://www.zaslike.com/viewer.php?file=9ba1zwvwr1itjeg7nhrf.png
Lord - slika sto izbaci kada stavim tvoje - http://www.zaslike.com/viewer.php?file=cg0ki1cgrcnnjk7rwfo.png

I kad ja to idem #define i pod newove stavim sve sto pise tu u erorima opet nista,opet se pojavi jos erora.Ja stvarno neam pojma u cem je stvar.Ako mozete pomoc ikako.Jer to mi je potrebno za server.I ovo od Looda i od Joeya..
Johnâ„¢
5
Godfather
3. Feb. 2013.
Ja sam svoj kod isprobao kod sebe što se tiče funkcije i sve radi kako treba.. Ti si nešto onda vjerojatno zeznuo.
Alen-Mata
4
Shot Caller
3. Feb. 2013.
Joey_ wrote on February 3, 2013, 10:48 am:
Ja sam svoj kod isprobao kod sebe što se tiče funkcije i sve radi kako treba.. Ti si nešto onda vjerojatno zeznuo.

Neznam sta se tu ima zeznit,ti si reko da zaljepim dol,ja sam zaljepio.
Stavio sam
//__________________________STOCK_____________________//
i ovdje sam ispod zaljepio taj stock
Johnâ„¢
5
Godfather
3. Feb. 2013.
Postaj baš da vidim kako si to stavio.
Alen-Mata
4
Shot Caller
3. Feb. 2013.
Ovo sam prvo stavio sto si reko
public OnPlayerText(playerid, text[])
{
new
message[128+1], pName[MAX_PLAYER_NAME+1];

    GetPlayerName(playerid, pName, sizeof(pName));

    format(message, sizeof(message), "%s: %s", pName, text);
sendICMessage(20.0, playerid, message);

        return 1;
}
- stavio sam pod OnPlayerText izbacuje  - C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(322) : warning 215: expression has no effect.To manje vise,to valja,mogu upalit srw i s tim jednim erorom.


STOCK stavim ovako
//____________________________STOCK_____________________________________//
stock sendICMessage(Float:dist, playerid, message[]) // By SA:MP team, edited by Joey_
{
    new
pName[MAX_PLAYER_NAME+1],
finalMsg[256+1];

if (!strlen(message)) return;

new
Float:fPlayerX, Float:fPlayerY, Float:fPlayerZ,
Float:fPlayerToPlayerDist,
Float:fNormDistance,
ColorScale,
ColorValue;

GetPlayerName(playerid, pName, sizeof(pName));

format(finalMsg, sizeof(finalMsg), "%s: %s", pName, message);

SendClientMessage(playerid, 0xD0D0D0FF, finalMsg);

GetPlayerPos(playerid, fPlayerX, fPlayerY, fPlayerZ);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && (i != playerid) && IsPlayerStreamedIn(playerid, i))
{
fPlayerToPlayerDist = GetPlayerDistanceFromPoint(i, fPlayerX, fPlayerY, fPlayerZ);

if (fPlayerToPlayerDist < dist)
{
fNormDistance = 1.0 - (fPlayerToPlayerDist / dist);

if(fNormDistance > 0.75) ColorScale = 220;
else ColorScale = floatround(96.0 + (128.0 * fNormDistance));

ColorValue = 0x000000FF | ColorScale << 24 | ColorScale << 16 | ColorScale << 8;
SendClientMessage(i, ColorValue, finalMsg);
}
}
}
}
- na kraj skripte,kao sto si reko,a erori su sljedeci.
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "fPlayerToPlayerDist"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "fPlayerX"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "fPlayerY"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "fPlayerZ"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "finalMsg"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "pName"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1160) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1162) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1166) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1170) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1171) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1173) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "ColorScale"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "ColorValue"

To su erori kada stavim stock,eto objasnio sam ti sve,ako ti tako nije jasno,poslat cu ti ako treba scriptu celi na PM :S
Johnâ„¢
5
Godfather
3. Feb. 2013.
Pošalji skriptu na PM jer ovako ne vidim nikakvu grešku.
Blaeks_Biofor
5
Forum Don
3. Feb. 2013.
Loupa wrote on February 3, 2013, 11:10 am:
Ovo sam prvo stavio sto si reko
public OnPlayerText(playerid, text[])
{
new
message[128+1], pName[MAX_PLAYER_NAME+1];

    GetPlayerName(playerid, pName, sizeof(pName));

    format(message, sizeof(message), "%s: %s", pName, text);
sendICMessage(20.0, playerid, message);

        return 1;
}
- stavio sam pod OnPlayerText izbacuje  - C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(322) : warning 215: expression has no effect.To manje vise,to valja,mogu upalit srw i s tim jednim erorom.


STOCK stavim ovako
//____________________________STOCK_____________________________________//
stock sendICMessage(Float:dist, playerid, message[]) // By SA:MP team, edited by Joey_
{
    new
pName[MAX_PLAYER_NAME+1],
finalMsg[256+1];

if (!strlen(message)) return;

new
Float:fPlayerX, Float:fPlayerY, Float:fPlayerZ,
Float:fPlayerToPlayerDist,
Float:fNormDistance,
ColorScale,
ColorValue;

GetPlayerName(playerid, pName, sizeof(pName));

format(finalMsg, sizeof(finalMsg), "%s: %s", pName, message);

SendClientMessage(playerid, 0xD0D0D0FF, finalMsg);

GetPlayerPos(playerid, fPlayerX, fPlayerY, fPlayerZ);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && (i != playerid) && IsPlayerStreamedIn(playerid, i))
{
fPlayerToPlayerDist = GetPlayerDistanceFromPoint(i, fPlayerX, fPlayerY, fPlayerZ);

if (fPlayerToPlayerDist < dist)
{
fNormDistance = 1.0 - (fPlayerToPlayerDist / dist);

if(fNormDistance > 0.75) ColorScale = 220;
else ColorScale = floatround(96.0 + (128.0 * fNormDistance));

ColorValue = 0x000000FF | ColorScale << 24 | ColorScale << 16 | ColorScale << 8;
SendClientMessage(i, ColorValue, finalMsg);
}
}
}
}
- na kraj skripte,kao sto si reko,a erori su sljedeci.
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "fPlayerToPlayerDist"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "fPlayerX"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "fPlayerY"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "fPlayerZ"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "finalMsg"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "pName"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1160) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1162) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1166) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1170) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1171) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1173) : error 010: invalid function or declaration
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "ColorScale"
C:\Users\PC\Desktop\Radius Gaming RP\gamemodes\RG.pwn(1179) : warning 203: symbol is never used: "ColorValue"

To su erori kada stavim stock,eto objasnio sam ti sve,ako ti tako nije jasno,poslat cu ti ako treba scriptu celi na PM :S
poslusaj me kad ti kazem  🙂

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha