Szerző Téma: ProxDetector hiba  (Megtekintve 1950 alkalommal)

ProxDetector hiba
« Dátum: 2011. Április 29. - 19:22:12 »
0 Show voters
Sziasztok!
Van ez a kód:
[pawn]#include <a_samp>
#define FILTERSCRIPT
//szinek
#define COLOR_WHITE                0xFFFFFFFF
#define COLOR_GREY1                0xE6E6E6FF
#define COLOR_GREY2                   0xBEBEBEFF
#define COLOR_GREY3                  0xA0A0A0FF
#define COLOR_GREY4                  0x828282FF
new string[50];
new getPlayerName[50];
public onPlayerText(playerid,text[])
{
     format(string, sizeof(string), getPlayerName(playerid)+ \" mondja: \" + text);
     ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_GREY1,COLOR_GREY2,COLOR_GREY3,COLOR_GREY4);
          return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, \"/s\", true))
   {
   format(string, sizeof(string), getPlayerName(playerid)+ \" ordítja: \" + text);
        ProxDetector(60.0, playerid, string,COLOR_WHITE,COLOR_GREY1,COLOR_GREY2,COLOR_GREY3,COLOR_GREY4);
       return 1;
}
if(!strcmp(cmdtext, \"/w\", true))
   {
   format(string, sizeof(string), getPlayerName(playerid)+ \" suttogja: \" + text);
        ProxDetector(20.0, playerid, string,COLOR_WHITE,COLOR_GREY1,COLOR_GREY2,COLOR_GREY3,COLOR_GREY4);
       return 1;
   }
if(!strcmp(cmdtext, \"/me\", true))
{
        GetPlayerName(playerid, string, sizeof(string));
        format(string, sizeof(string), \"%s %s\", string, cmdtext[4]);
   ProxDetector(30.0, playerid,COLOR_WHITE,COLOR_GREY1,COLOR_GREY2,COLOR_GREY3,COLOR_GREY4);
        return 1;
}
return 1;
}[/pawn]
nem mûködik.  :(
errorok: [pawn]alapcmds.pwn(15) : error 012: invalid function call, not a valid address
alapcmds.pwn(15) : warning 215: expression has no effect
alapcmds.pwn(15) : error 001: expected token: \";\", but found \")\"
alapcmds.pwn(15) : error 029: invalid expression, assumed zero
alapcmds.pwn(15) : fatal error 107: too many error messages on one line[/pawn]
Sorok amikben vannak:
[pawn]15.sor: format(string, sizeof(string), getPlayerName(playerid)+ \" mondja: \" + text);[/pawn]
Köszi a segítséget! :)
« Utoljára szerkesztve: 2011. Április 29. - 19:24:02 írta mauladam »

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
ProxDetector hiba
« Válasz #1 Dátum: 2011. Április 29. - 19:36:04 »
0 Show voters
[pawn]new getPlayerName [ MAX_PLAYER_NAME ];
new string [ 128 ];
public OnPlayerText ( playerid, text[ ] )
{
    GetPlayerName ( playerid, getPlayerName, MAX_PLAYER_NAME );
    format ( string, 128, \"%s mondja: %s\", getPlayerName, text);
    ProxDetector ( 30.0, playerid, string,COLOR_WHITE,COLOR_GREY1,COLOR_GREY2,COLOR_GREY3,COLOR_GREY4 );
    return 1;
}[/pawn]
Szerk.: 1848. Hozzászólás! ,,Isten áld meg a magyart...!\'\'
« Utoljára szerkesztve: 2011. Április 29. - 21:30:26 írta SticK »

ProxDetector hiba
« Válasz #2 Dátum: 2011. Április 29. - 21:29:25 »
0 Show voters
Köszönöm a segítséget, de igy sem jó. most ezeket a hibákat dobja fel a forditásnál:
 
alapcmds.pwn(17) : error 001: expected token: \"-string end-\", but found \"-identifier-\"
alapcmds.pwn(17) : warning 215: expression has no effect
alapcmds.pwn(17) : warning 215: expression has no effect
alapcmds.pwn(17) : error 001: expected token: \";\", but found \")\"
alapcmds.pwn(17) : error 029: invalid expression, assumed zero
alapcmds.pwn(17) : fatal error 107: too many error messages on one line

 
17.sor:
format ( string, 128, \"%s mondja: %s\" getPlayerName, text);

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
ProxDetector hiba
« Válasz #3 Dátum: 2011. Április 29. - 21:31:12 »
0 Show voters
Bocsi, egy ,(vesszõ) lemaradt.   :)
Javítottam.  ;)

ProxDetector hiba
« Válasz #4 Dátum: 2011. Április 29. - 21:55:59 »
0 Show voters
Köszönöm, jó is lenne sztem, de még egy kérdésem lenne:
Hibakód:
undefined symbol \"ProxDetector\"

 
Az lenne a kérdésem hogy a ProxDetectort be kell include-olni, v csak definiálni, v new-val kell?
 :question:
(Most használom elõször a ProxDetectort azért nem tudom.) ;)

Nem elérhető Stray

  • 617
    • Profil megtekintése
ProxDetector hiba
« Válasz #5 Dátum: 2011. Április 29. - 23:05:16 »
0 Show voters
Tessék. Csak nevezd át Msgt-röl
[pawn]stock Msgt(Float:radi, playerid, string[],col1,col2,col3,col4,col5)//avagy proxdetector
{
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) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)) && (GetPlayerInterior(playerid) == GetPlayerInterior(i)))//Getplayerinterior hozzáadva(by straY)
      {
            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, 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);
            }
      }
   }
}//not connected
return 1;
}[/pawn]

ProxDetector hiba
« Válasz #6 Dátum: 2011. Április 29. - 23:06:55 »
0 Show voters
Köszönöm! tesztelem. ;)

ProxDetector hiba
« Válasz #7 Dátum: 2011. Április 29. - 23:09:55 »
0 Show voters
Mûködik! :D Zárok! :)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal