[Pomoc] IC i OOC chat.

Započeo Rossâ„¢ =], Februar 02, 2013, 22:46:18 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 5 gostiju pregledaju ovu temu.

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
NEW NEW NEW

Team Fortress od sada i na SA:MP-u!!!
Dodite i zabavite se!

IP: 62.210.122.191:7789

Izbacuje i fatal erore kad zaljepim.I vidim da to nije YCMD.
NEW NEW NEW

Team Fortress od sada i na SA:MP-u!!!
Dodite i zabavite se!

IP: 62.210.122.191:7789

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[128], finalMessage[128+1], pName[MAX_PLAYER_NAME+1];

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

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

format(finalMessage, sizeof(finalMessage), "(( %s: %s ))", pName, finalMessage);
SendClientMessageToAll(0xD0D0D0FF, finalMessage);
return 1;
}
Poslednja Izmena: Februar 02, 2013, 23:06:45 POSLE PODNE od Joey_

Last nick: Paradox

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 [text]
Nevalja ti--
Ovo prvo OnPlayerText valja , to sam ustimo.
NEW NEW NEW

Team Fortress od sada i na SA:MP-u!!!
Dodite i zabavite se!

IP: 62.210.122.191:7789

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

Last nick: Paradox


evo brt znaci pod onplayertext posto verovatno imas proxdetector
public OnPlayerText(playerid, text[])
{
new str[128];
new ime[MAX_PLAYERS_NAME];
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;
}

ja ti kao i lood preporucujem da koristis proxdetector + ycmd u takvim komandama

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..
NEW NEW NEW

Team Fortress od sada i na SA:MP-u!!!
Dodite i zabavite se!

IP: 62.210.122.191:7789

Ja sam svoj kod isprobao kod sebe što se tiče funkcije i sve radi kako treba.. Ti si nešto onda vjerojatno zeznuo.

Last nick: Paradox

Citat: Joey_ poslato Februar 03, 2013, 11:48:19 PRE PODNE
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
NEW NEW NEW

Team Fortress od sada i na SA:MP-u!!!
Dodite i zabavite se!

IP: 62.210.122.191:7789

Postaj baš da vidim kako si to stavio.

Last nick: Paradox

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
NEW NEW NEW

Team Fortress od sada i na SA:MP-u!!!
Dodite i zabavite se!

IP: 62.210.122.191:7789

Pošalji skriptu na PM jer ovako ne vidim nikakvu grešku.

Last nick: Paradox

Citat: Loupa poslato Februar 03, 2013, 12:10:22 POSLE PODNE
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  :)