Szerző Téma: Frakció chat (afféle rádió)  (Megtekintve 1348 alkalommal)

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Frakció chat (afféle rádió)
« Dátum: 2013. Február 08. - 13:22:02 »
0 Show voters
Sziasztok.
Nos, elkezdtem egy frakció scriptet, amelynek a mentésében már kértem is segítséget fórumon. Egy rádió scriptet akarok elkészíteni.
Ezzel a kóddal lehet lekérdezni, hogy milyen frakcióban van az adott játékos:
 
if(PlayerInfo[playerid][Frakcio] == 1)

 
Hogyan tudnám megcsinálni, hogy csak a Frakció 1-ben lássák azt, amit õ ír, és csak frakció 1-es tudjon? (Biztos értik a nagy RP fanok)
U.i: Bocs, hogy elõször érthetetlenül írtam le a dolgokat, infó órán siettem :)
« Utoljára szerkesztve: 2013. Február 08. - 13:54:21 írta Petrik »

Nem elérhető Amf

  • 1459
    • Profil megtekintése
Frakció chat (afféle rádió)
« Válasz #1 Dátum: 2013. Február 08. - 14:05:39 »
+1 Show voters
Ha valami gond van szólj, jegyzettömbben írtam.


CMD:radio( playerid, params[] )
{
if( pInfo[ playerid ][ Frakcio ] == 1 )
{
    new STRING1[ 128 ], STRING2[ 128 ], PlayerName[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, PlayerName, sizeof( PlayerName ) );
   
if( sscanf( params, \"s[128]\", STRING1 ) ) return SendClientMessage( playerid, -1, \"* Használat: /radio [ szöveg ]\" );
format( STRING2, sizeof( STRING2 ), \"[RÁDIÓ] %s mondja: %s *\", PlayerName, STRING1 );
SendFractionMessage( -1, STRING, 1 );
return 1;
}
else
{
    SendClientMessage( playerid, -1, \"Ezt csak az 1-es frakcióban lévõk használhatják!\" );
}
return 1;
}
stock SendFractionMessage( color, string[ ], number )
{
for( new i; i < MAX_PLAYERS; i ++ )
{
    if( pInfo[ i ][ Frakcio ] == number )
    {
        SendClientMessage( i, color, string );
}
}
return 1;
}

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Frakció chat (afféle rádió)
« Válasz #2 Dátum: 2013. Február 08. - 14:22:38 »
0 Show voters
Idézetet írta: AmF date=1360328739\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"33553\" data-ipsquote-contentclass=\"forums_Topic
Ha valami gond van szólj, jegyzettömbben írtam.


CMD:radio( playerid, params[] )
{
if( pInfo[ playerid ][ Frakcio ] == 1 )
{
    new STRING1[ 128 ], STRING2[ 128 ], PlayerName[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, PlayerName, sizeof( PlayerName ) );
   
if( sscanf( params, \"s[128]\", STRING1 ) ) return SendClientMessage( playerid, -1, \"* Használat: /radio [ szöveg ]\" );
format( STRING2, sizeof( STRING2 ), \"[RÁDIÓ] %s mondja: %s *\", PlayerName, STRING1 );
SendFractionMessage( -1, STRING, 1 );
return 1;
}
else
{
    SendClientMessage( playerid, -1, \"Ezt csak az 1-es frakcióban lévõk használhatják!\" );
}
return 1;
}
stock SendFractionMessage( color, string[ ], number )
{
for( new i; i < MAX_PLAYERS; i ++ )
{
    if( pInfo[ i ][ Frakcio ] == number )
    {
        SendClientMessage( i, color, string );
}
}
return 1;
}

 




D:\\Játékok\\GTA\\...(201) : error 028: invalid subscript (not an array or too many subscripts): \"pInfo\"
D:\\Játékok\\GTA\\...(201) : warning 215: expression has no effect
D:\\Játékok\\GTA\\...(201) : error 001: expected token: \";\", but found \"]\"
D:\\Játékok\\GTA\\...(201) : error 029: invalid expression, assumed zero
D:\\Játékok\\GTA\\...(201) : fatal error 107: too many error messages on one line

 

201-es sor:

if(pInfo[Frakcio] == number)

Nem elérhető Iceaac

  • 2187
    • Profil megtekintése
Frakció chat (afféle rádió)
« Válasz #3 Dátum: 2013. Február 08. - 14:41:57 »
+1 Show voters
Cseréld le a sorban a
 
pInfo[Frakcio]

 
részt erre:
 
PlayerInfo[Frakcio]

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Frakció chat (afféle rádió)
« Válasz #4 Dátum: 2013. Február 08. - 14:47:52 »
0 Show voters
Idézetet írta: Iceaac date=1360330917\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"33553\" data-ipsquote-contentclass=\"forums_Topic
Cseréld le a sorban a
 
pInfo[Frakcio]

 
részt erre:
 
PlayerInfo[Frakcio]

 

Aha. Így jó, most ez a hibás:
 
SendFractionMessage(COLOR_RADIO, STRING, 1);

 

error 017: undefined symbol \"STRING\"

Nem elérhető Amf

  • 1459
    • Profil megtekintése
Frakció chat (afféle rádió)
« Válasz #5 Dátum: 2013. Február 08. - 23:52:37 »
0 Show voters
Már, bocs de nem igaz, hogy ennyit nem látsz / nem tudsz javítani.


format( STRING2, sizeof( STRING2 ), \"[RÁDIÓ] %s mondja: %s *\", PlayerName, STRING1 );     
SendFractionMessage( -1, STRING2, 1 );

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Frakció chat (afféle rádió)
« Válasz #6 Dátum: 2013. Február 09. - 10:58:50 »
0 Show voters
Idézetet írta: AmF date=1360363957\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"33553\" data-ipsquote-contentclass=\"forums_Topic
Már, bocs de nem igaz, hogy ennyit nem látsz / nem tudsz javítani.


format( STRING2, sizeof( STRING2 ), \"[RÁDIÓ] %s mondja: %s *\", PlayerName, STRING1 );     
SendFractionMessage( -1, STRING2, 1 );

 



Van amiben nagyon jó vagyok Pawnoban, van, amiben rohadt szar :D Amúgy thx.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal