public OnPlayerText(playerid, text[]){if(text[0] == \'!\'){for(new i = 0; i <= MAX_PLAYERS; i++){ if(IsPlayerConnected(i)) { if(gTeam[playerid] == TEAM_VIP) { new string[128]; GetPlayerName(playerid,string,sizeof(string)); format(string,sizeof(string),\"VipChat: %s: %s\",string,text[1]); SendClientMessage(i, 0xFFFF00AA, string); return 0; } }}}return 1;}
if(gTeam[playerid] == TEAM_VIP[ i])[/quote]A csapatok definícióiban konstans értékeket szoktak megadni, így nem lesz jó, ha vektorba teszed. format(string,sizeof(string),\"VipChat: %s: %s\",string,text[1]);[/quote]Ez csak a játékos által bevitt második karaktert fogja formázni, illetve elküldeni( persze csak ha az elso egy \'!\' jel ).ZeRo
format(string,sizeof(string),\"VipChat: %s: %s\",string,text[1]);[/quote]Ez csak a játékos által bevitt második karaktert fogja formázni, illetve elküldeni( persze csak ha az elso egy \'!\' jel ).ZeRo
F:\\Sas5.pwn(985) : error 017: undefined symbol \"gTeam\"F:\\Sas5.pwn(985) : warning 215: expression has no effectF:\\Sas5.pwn(985) : error 001: expected token: \";\", but found \"]\"F:\\Sas5.pwn(985) : error 029: invalid expression, assumed zeroF:\\Sas5.pwn(985) : fatal error 107: too many error messages on one lineCompilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 4 Errors.
985 if(gTeam[playerid] == Vip[1])
#include team
if(gTeam[playerid] == TEAM_VIP[ i])A csapatok definícióiban konstans értékeket szoktak megadni, így nem lesz jó, ha vektorba teszed. [/quote]Csak magamat tudom ismételni. Írok egy példát, ami alapján össze tudod hozni magadnak. #include < a_samp >#define COLOR_YELLOW 0xFFFF00AA#define TEAM_VIP 1new Team[ MAX_PLAYERS ] = 0, pName[ MAX_PLAYER_NAME ];public OnPlayerText( playerid, text[ ] ) { if( Team[ playerid ] == TEAM_VIP ) { new z[ 128 ]; GetPlayerName( playerid, pName, sizeof( pName ) ); format( z, sizeof( z ), \"[ Vip ] %s: %s\", pName, text ); for( new vipid = 0; vipid < MAX_PLAYERS; vipid++ ) { if( IsPlayerConnected( vipid ) && Team[ vipid ] == TEAM_VIP ) { SendClientMessage( vipid, COLOR_YELLOW, z ); return 0; } } } return 1;}public OnPlayerCommandText( playerid, cmdtext[ ] ) {if( strcmp( \"/vipchat\", cmdtext, true ) == 0 ) { if( Team[ playerid ] == TEAM_VIP ) { Team[ playerid ] = 0; SendClientMessage( playerid, COLOR_YELLOW, \"Mostantól a rendes chatbox - ba írsz!\" ); } else { Team[ playerid ] = TEAM_VIP; SendClientMessage( playerid, COLOR_YELLOW, \"Mostantól a Vip chat - be írsz!\" ); }return 1;}return 0;} ZeRo
if(gTeam[playerid] == TEAM_VIP[ i])
#include < a_samp >#define COLOR_YELLOW 0xFFFF00AA#define TEAM_VIP 1new Team[ MAX_PLAYERS ] = 0, pName[ MAX_PLAYER_NAME ];public OnPlayerText( playerid, text[ ] ) { if( Team[ playerid ] == TEAM_VIP ) { new z[ 128 ]; GetPlayerName( playerid, pName, sizeof( pName ) ); format( z, sizeof( z ), \"[ Vip ] %s: %s\", pName, text ); for( new vipid = 0; vipid < MAX_PLAYERS; vipid++ ) { if( IsPlayerConnected( vipid ) && Team[ vipid ] == TEAM_VIP ) { SendClientMessage( vipid, COLOR_YELLOW, z ); return 0; } } } return 1;}public OnPlayerCommandText( playerid, cmdtext[ ] ) {if( strcmp( \"/vipchat\", cmdtext, true ) == 0 ) { if( Team[ playerid ] == TEAM_VIP ) { Team[ playerid ] = 0; SendClientMessage( playerid, COLOR_YELLOW, \"Mostantól a rendes chatbox - ba írsz!\" ); } else { Team[ playerid ] = TEAM_VIP; SendClientMessage( playerid, COLOR_YELLOW, \"Mostantól a Vip chat - be írsz!\" ); }return 1;}return 0;}