Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: MatheuS on July 20, 2012, 07:17:55 pm

Title: chat only for VIPs
Post by: MatheuS on July 20, 2012, 07:17:55 pm
[pawn]else if ( strcmp( cmd, "vip", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
      else if ( !strlen( tmp ) ) { SendClientMessage( playerid, COLOR_GREEN, "USAGE: /c vip [Message]" ); }
      else
      {
         new szMsg[ 128 ];
         format( szMsg, 128, "** vip %s: %s", gPlayers[ playerid ], cmdtext[ 3 ] );
         SendClientMessageToAll( RED, szMsg );
      }
      return 1;
      }[/pawn]
Title: Re: chat only for VIPs
Post by: LisKa on July 20, 2012, 07:33:12 pm
Use snippet showroom.
Title: Re: chat only for VIPs
Post by: asderwin on July 23, 2012, 10:39:16 pm

else if ( strcmp( cmd, "t", true ) == 0 ){
for(i = 0; i < MAX_PLAYERS; i++)
{
new Float:tX,Float:tY,Float:tZ;
GetPlayerPos(playerid,tX,tY,tZ);
if(PlayerToPoint(15.0,i,tX,tY,tZ))
{
new str[ 128 ];
format(str,128, "[%s]Dice:%s.",gPlayers[ playerid ],cmdtext[2]);
SendClientMessage(i,COLOR_YELLOW,str);

}
}
   return 1;
   }


public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
   {
      new Float:oldposx, Float:oldposy, Float:oldposz;
      new Float:tempposx, Float:tempposy, Float:tempposz;
      GetPlayerPos(playerid, oldposx, oldposy, oldposz);
      tempposx = (oldposx -x);
      tempposy = (oldposy -y);
      tempposz = (oldposz -z);
      if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
      {
         return 1;
      }
   }
   return 0;
}

agradescan por lo menos los noobs

{ (Abraham_Blanco) && [Professsional-Spawno-Scripts] }

(http://img3.imageshack.us/img3/586/mifirmay.jpg)
Title: Re: chat only for VIPs
Post by: aledark24 on July 24, 2012, 06:52:41 am
buena Abraham the best.....  en serio bajale los humos a tu cabeza "dilson version venezolano"
Title: Re: chat only for VIPs
Post by: sseebbyy on July 24, 2012, 04:36:56 pm
"SendClientMessageToAll" isn't set to send a message to all online players ?

You need to use "SendClientMessage" to all VIPs online .