GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: Petrik - 2013. február 08. - 13:22:02

Cím: Frakció chat (afféle rádió)
Írta: Petrik - 2013. február 08. - 13:22:02
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 :)
Cím: Frakció chat (afféle rádió)
Írta: Amf - 2013. február 08. - 14:05:39
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;
}
Cím: Frakció chat (afféle rádió)
Írta: Petrik - 2013. február 08. - 14:22:38
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)
Cím: Frakció chat (afféle rádió)
Írta: Iceaac - 2013. február 08. - 14:41:57
Cseréld le a sorban a
 
pInfo[Frakcio]

 
részt erre:
 
PlayerInfo[Frakcio]
Cím: Frakció chat (afféle rádió)
Írta: Petrik - 2013. február 08. - 14:47:52
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\"
Cím: Frakció chat (afféle rádió)
Írta: Amf - 2013. február 08. - 23:52:37
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 );
Cím: Frakció chat (afféle rádió)
Írta: Petrik - 2013. február 09. - 10:58:50
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.