-
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 :)
-
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;
}
-
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)
-
Cseréld le a sorban a
pInfo[Frakcio]
részt erre:
PlayerInfo[Frakcio]
-
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\"
-
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 );
-
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.