Szerző Téma: RP - /me parancs  (Megtekintve 5034 alkalommal)

RP - /me parancs
« Dátum: 2011. Július 06. - 19:21:31 »
0 Show voters
[pawn]CMD:me(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD1, \"Használat.: /me [cselekvés]\");
    new
        string[128],
        pName[128 char]
    ;
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), \"* %s %s\", pName, params);
    return SendClientMessageToAll(COLOR_ME, string);
}[/pawn]
eddig oké. Felmentem a szerverre tesztelni,és mindenki látta a szerveren >.< hogy tudom megoldani,hogy a közelemben lévõ játékosok lássák csak?
Köszi elõre is!
« Utoljára szerkesztve: 2011. Július 06. - 19:39:36 írta ►ѕтaЯ◄ »

Nem elérhető shadee

  • 1073
    • Profil megtekintése
RP - /me parancs
« Válasz #1 Dátum: 2011. Július 06. - 19:24:51 »
0 Show voters
Idézetet írta: Kyeman date=1309972891\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"9460\" data-ipsquote-contentclass=\"forums_Topic
CMD:me(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD1, \"Használat.: /me [cselekvés]\");
    new
        string[128],
        pName[128 char]
    ;
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), \"* %s %s\", pName, params);
    return SendClientMessageToAll(COLOR_ME, string);
}
eddig oké. Felmentem a szerverre tesztelni,és mindenki látta a szerveren >.< hogy tudom megoldani,hogy a közelemben lévõ játékosok lássák csak?
Köszi elõre is!
 
SendClientMessageToAll(COLOR_ME, string);
emiatt
Csinálj egy sima chatet és azt csináld meg hogy X méterig láthasság
X=amennyit te megadsz

RP - /me parancs
« Válasz #2 Dátum: 2011. Július 06. - 19:29:49 »
0 Show voters
megírnád nekem azt a pár sort? Kérlek. nem vágom hogy kellene,de utána rájönnek a leírásból :D

Nem elérhető ►ѕтa

  • 2016
  • Newbie
    • Profil megtekintése
RP - /me parancs
« Válasz #3 Dátum: 2011. Július 06. - 19:39:10 »
0 Show voters
[pawn]CMD:me(playerid, params[ ])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD1, \"Használat.: /me [cselekvés]\");
new string[128], pName[24];
GetPlayerName(playerid, pName, sizeof(pName));
new i, Float:X, Float:Y, Float:Z;
while(i < SZERVER SLOTJA)
{
   i++;
   GetPlayerPos(playerid, X, Y, Z);
   if(IsPlayerInRangeOfPoint(5.0, playerid, X, Y, Z))
   {
      format(string, sizeof(string), \"* %s %s\", pName, params);
      SendClientMessage(i, COLOR_ME, string);
   }
}
return 1;
}[/pawn]

RP - /me parancs
« Válasz #4 Dátum: 2011. Július 06. - 19:53:37 »
0 Show voters
és ez így,teljesen perfekt lesz? :)
Köszönöm Szépen!

Dupla hozzászólás automatikusan összefûzve. ( 2011. Július 06. - 20:02:26 )

Valami nem jó,ha beírom a parancsot semmi nem történik :/
« Utoljára szerkesztve: 2011. Július 06. - 20:02:26 írta Kyeman »

Nem elérhető petya

  • 433
    • Profil megtekintése
RP - /me parancs
« Válasz #5 Dátum: 2011. Július 06. - 20:28:07 »
+1 Show voters
SendClientMessageToAll

 
shadee ez  mindenkinek mutatja  8) mint az asay  ;)

RP - /me parancs
« Válasz #6 Dátum: 2011. Július 06. - 20:33:19 »
0 Show voters
Valami nem jó,ha beírom a parancsot semmi nem történik :/

Nem elérhető MaD

  • 153
    • Profil megtekintése
RP - /me parancs
« Válasz #7 Dátum: 2011. Július 06. - 20:43:48 »
0 Show voters
Idézetet írta: ►ѕтaЯ◄ date=1309973950\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"9460\" data-ipsquote-contentclass=\"forums_Topic
[pawn]CMD:me(playerid, params[ ])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD1, \"Használat.: /me [cselekvés]\");
new string[128], pName[24];
GetPlayerName(playerid, pName, sizeof(pName));
new i = 0, Float:X, Float:Y, Float:Z;
while(i < MAX_PLAYERS)
{
   i++;
   GetPlayerPos(i, X, Y, Z);
   if(IsPlayerInRangeOfPoint(5.0, i, X, Y, Z))
   {
      format(string, sizeof(string), \"* %s %s\", pName, params);
      SendClientMessage(i, COLOR_ME, string);
   }
}
return 1;
}[/pawn]
 
Én inkább így csinálnám :P
u.i.: Nem teszteltem
« Utoljára szerkesztve: 2011. Július 06. - 20:48:38 írta MaD »

RP - /me parancs
« Válasz #8 Dátum: 2011. Július 06. - 22:00:28 »
0 Show voters
ez sem csinál semmit.. beírom és nem történik semmi..

Nem elérhető MaD

  • 153
    • Profil megtekintése
RP - /me parancs
« Válasz #9 Dátum: 2011. Július 07. - 07:34:08 »
0 Show voters
[pawn]CMD:me(playerid, params[ ])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD1, \"Használat.: /me [cselekvés]\");
new string[128], pName[24];
GetPlayerName(playerid, pName, sizeof(pName));
        format(string, sizeof(string), \"* %s %s\", pName, params);
SendClientMessage(playerid, COLOR_ME, string);
new i = -1, Float:X, Float:Y, Float:Z;
while(i < MAX_PLAYERS)
{
   i++;
   GetPlayerPos(i, X, Y, Z);
   if(IsPlayerInRangeOfPoint(5.0, i, X, Y, Z))
   {
      SendClientMessage(i, COLOR_ME, string);
   }
}
return 1;
}[/pawn]
Próbáld így, habár ezt sem teszteltem

Nem elérhető Delta

  • 159
    • Profil megtekintése
RP - /me parancs
« Válasz #10 Dátum: 2011. Július 07. - 10:04:00 »
0 Show voters
CMD:me(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFFF, \"{0080FF}Használat:{FFFFFF} /me [CSELEKVÉS]\");
    else if((strlen(params) + 24) > 127) return SendClientMessage(playerid, 0xFFFFFFFF, \"A cselekvés 0 és 127 karakter hosszúságú lehet.\");
    new string[128];
    format(string, sizeof(string), \"* %s %s\", GetPlayerNameEx(playerid), params);
    SendClientMessageEx(playerid, 5.0, 0xFF8AFFAA, string);
    return 1;
}

 

stock SendClientMessageEx(playerid, Float: rad, color = 0xFF66FFAA, const message[])
{
static Float: cord[4];
for(new index = 0; index < 30; ++index)
{
    if(IsPlayerConnected(index))
{
            GetPlayerPos(playerid, cord[0], cord[1], cord[2]);
            if(IsPlayerInRangeOfPoint(index, rad, cord[0], cord[1], cord[2]))
   {
                SendClientMessage(index, color, message);
   }
}
}
return 1;
}

 

stock GetPlayerNameEx(playerid)
{
    new str[24];
    GetPlayerName(playerid,str,24);
    return str;
}
« Utoljára szerkesztve: 2011. Július 07. - 10:05:52 írta Delta »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal