Quote:
Originally Posted by XtremeR
try this :
pawn Код:
stock MessageToAdmins(color, const message[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if PlayerData[playerid][AdmLvl] >=1 ) SendClientMessage(i, color, string); } return 1; }
Works Perfect for me..
|
pawn Код:
C:\Users\Vyom\Desktop\SA-MP 3e\gamemodes\StuntWars.pwn(3326) : error 001: expected token: "*then", but found ")"
C:\Users\Vyom\Desktop\SA-MP 3e\gamemodes\StuntWars.pwn(3326) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
And as you're looping the
playerid should be "
i"
Quote:
Originally Posted by costel_nistor96
You don't have why to check IsPlayerConnected in a foreach loop, remove this check, foreach is doing this for you.
This is all of your OnPlayerText code ?
|
Yes, that's the only code on my OnPlayerText.
Quote:
Originally Posted by HuSs3n
Afaik , OnPlayerText Must return 0, or the text will be sent twice.
pawn Код:
public OnPlayerText(playerid, text[]) { if ( Muted [ playerid ] == 1 ) { format ( SStr , 128 , "You've been muted from the chat" ) ; SendClientMessage ( playerid , -1 , SStr ) ; return 0 ; }
if ( ( text [ 0 ] == '*' ) && PlayerData [ playerid ] [ VIPLvl ] >= 1 && strlen(text) > 1 ) { format ( SStr , sizeof ( SStr ) , "|ChatVip| %s(%d): %s" , pName ( playerid ) , playerid , text [ 1 ] ) ; MessageToPlayerVIP ( -1 , SStr ) ; SaveLog ( "VIPChatLog" , SStr ) ; return 0 ; } if ( ( text [ 0 ] == '#' ) && PlayerData [ playerid ] [ AdmLvl ] >= 1 && strlen(text) > 1 ) { format ( SStr , sizeof ( SStr ) , "Admin Chat: %s: %s" , pName ( playerid ) , text [ 1 ] ) ; MessageToAdmins ( green , SStr ) ; SaveLog ( "AdmChatLog" , SStr ) ; return 0 ; } else { SendPlayerMessageToAll(playerid, text); } SaveChatLog ( playerid , "ChatLogs" , text ) ; return 0 ; }
|
I tried it before. Doesn't seems to be working.