Szerző Téma: aki ért hozzá kérem kijavítaná a /me parancsom?  (Megtekintve 705 alkalommal)

Nem elérhető buci11

  • 502
    • Profil megtekintése
aki ért hozzá kérem kijavítaná a /me parancsom?
« Dátum: 2012. január 02. - 13:37:16 »
0 Show voters
nem megy mert beírom hogy /me blabla és azt írja mint amikor simán /me t írok tehát hogy hogyan kell használni
[pawn]CMD:me(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new cselekmeny;
new name[MAX_PLAYER_NAME], string[100+MAX_PLAYER_NAME];
for(new i=0;i<MAX_PLAYERS;i++)
{
   if(IsPlayerConnected(i)==1)
   {
      if(IsPlayerInRangeOfPoint(i, 20, x, y, z))
      {
         GetPlayerName(playerid, name, sizeof(name));
         if(sscanf(params,\"z\",cselekmeny)) return SendClientMessage(playerid,COLOR_AQUA,\"Használat:/me [Cselekmény]\");
         format(string, sizeof(string), \"*%s %s\", name , cselekmeny);
         SendClientMessage(i,COLOR_YELLOW,string);
      }
   }
}
return 1;
}[/pawn]
« Utoljára szerkesztve: 2012. január 02. - 14:07:05 írta buci11 »

Nem elérhető IXT

  • 2502
  • Steph Curry
    • Profil megtekintése
aki ért hozzá kérem kijavítaná a /me parancsom?
« Válasz #1 Dátum: 2012. január 02. - 13:41:42 »
+1 Show voters
COMMAND:me(playerid, params[])
{
    new SenderName[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid,SenderName,sizeof(SenderName));
    if(isnull(params)) return SendClientMessage(playerid, 0xFFFF00AA,\"HIBA: hasznald /me [cselekves]\");
    format(string, sizeof(string), \"*%s %s\", SenderName, params);
    SendClientMessageToAll( 0xFFFF00AA, string);
    return 1;
}

 
nekem igy van

Nem elérhető UppeR!

  • 1134
    • Profil megtekintése
aki ért hozzá kérem kijavítaná a /me parancsom?
« Válasz #2 Dátum: 2012. január 02. - 13:44:56 »
0 Show voters
#include <a_samp>
#include <zcmd>
#define      COLOR_PURPLE          0xC2A2DAAA
#define      COLOR_AQUA            0x7CFC00AA
forward ProxDetector(Float:radi, playerid, strp[], col1, col2, col3, col4, col5);
public ProxDetector(Float:radi, playerid, strp[], 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; i < MAX_PLAYERS; i++) {
            if(IsPlayerConnected(i)) {
                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))) SendClientMessage(i, col1, strp);
                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) SendClientMessage(i, col2, strp);
                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) SendClientMessage(i, col3, strp);
                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) SendClientMessage(i, col4, strp);
                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) SendClientMessage(i, col5, strp);
            }
        }
    }
    return 1;
}
CMD:me(playerid, params[]) {
if(isnull(params)) return SendClientMessage(playerid,COLOR_AQUA,\"Használat:/me [Cselekmény]\");
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof(name));
format(str, 128, \"%s %s.\", name, params);
ProxDetector(20.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerChatBubble(playerid, params, COLOR_PURPLE, 25.0, 8000);
return 1;
}
« Utoljára szerkesztve: 2012. január 02. - 14:13:48 írta UppeR! »

Nem elérhető buci11

  • 502
    • Profil megtekintése
aki ért hozzá kérem kijavítaná a /me parancsom?
« Válasz #3 Dátum: 2012. január 02. - 14:07:30 »
+1 Show voters
ez ennyire bonyolult? :D nekem amúgy erre 21 errort ír

dexi

  • Vendég
aki ért hozzá kérem kijavítaná a /me parancsom?
« Válasz #4 Dátum: 2012. január 02. - 14:14:01 »
0 Show voters
lol, mi az a \"z\" ott? Amit beírsz az egy string, megkell adnod a karakterlánchosszúságát
 

new cselekmeny[128];

 
és akkor az sscanf-ba azt kell írnod hogy
 
.......\"s[128]\",cselekmeny......

Nem elérhető UppeR!

  • 1134
    • Profil megtekintése
aki ért hozzá kérem kijavítaná a /me parancsom?
« Válasz #5 Dátum: 2012. január 02. - 14:15:41 »
0 Show voters
Módosítottam, mert én foreach-ot használtam benne.
Nem bonyolult, a ProxDetector függvényt bármilyen más parancsban felhasználhatod.

dexi

  • Vendég
aki ért hozzá kérem kijavítaná a /me parancsom?
« Válasz #6 Dátum: 2012. január 02. - 14:17:03 »
0 Show voters
CMD:me(playerid, params&#91;])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new cselekmeny[128];
new name[MAX_PLAYER_NAME], string[100+MAX_PLAYER_NAME];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i)==1)
{
   if(IsPlayerInRangeOfPoint(i, 20, x, y, z))
   {
      GetPlayerName(playerid, name, sizeof(name));
      if(sscanf(params,\"s[128]\",cselekmeny)) return SendClientMessage(playerid,COLOR_AQUA,\"Használat:/me [Cselekmény]\");
      format(string, sizeof(string), \"*%s %s.\", name , cselekmeny);
      SendClientMessage(i,COLOR_YELLOW,string);
   }
}
}
return 1;
}

 
Tess.

Nem elérhető buci11

  • 502
    • Profil megtekintése
aki ért hozzá kérem kijavítaná a /me parancsom?
« Válasz #7 Dátum: 2012. január 02. - 15:52:19 »
+1 Show voters
köszi megvan zárok

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal