Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: shaheersa on December 26, 2012, 12:58:53 am

Title: I need help with command /c bringall
Post by: shaheersa on December 26, 2012, 12:58:53 am
Hi scripters,
i need some help
/c mute [player] = player cant write anything in chat ---------------------I dont need this command
/c reloadscript = reload the script without needing to restart the server --------------------------- I fixed it myself
/c bringall

Thanks
Title: Re: I need help with command /c mute and /c reloadscript
Post by: Fuzzy168 on December 26, 2012, 05:44:01 am
/c mute = Impossible in Pawn, Possible in Squirrel
/c reloadscript = Impossible in Pawn, Possible in Squirrel
Title: Re: I need help with command /c mute and /c reloadscript
Post by: shaheersa on December 26, 2012, 12:07:00 pm
/c mute is possible, i saw it on non-sq(pawn) servers
well im not sure about /c reloadscript
Title: Re: I need help with command /c mute and /c reloadscript
Post by: aledark24 on December 26, 2012, 03:14:57 pm
/c mute = Impossible in Pawn, Possible in Squirrel
/c reloadscript = Impossible in Pawn, Possible in Squirrel
1 cuestion mute is possible in pawn but only.work if the player use t and write the message
but if player use /me or another command not work
reload.script?
not is possible reload script in any script sq or pawn
Title: Re: I need help with command /c mute and /c reloadscript
Post by: mrockxkingbutt on December 26, 2012, 03:17:47 pm
[pawn]   else if(strcmp(cmd,"mute",true) == 0)
   {
   IsPlayerAdmin(playerid);
   {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      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_RED,"USAGE: /c mute [Nick/ID]");
        else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
      else {
      if(PlayerInfo[plr][Muted] == 0)
      {
      PlayerInfo[plr][Muted] = 1;
      new str[256];
      format(str,sizeof(str),"ADMIN %s Muted %s for a long time...",gPlayers[playerid],gPlayers[plr]);
      SendClientMessageToAll(COLOR_WHITE,str);
      SendClientMessage(plr,COLOR_RED,"Stop talking or you will be kicked...");
      }
      else
      {
      SendClientMessage(playerid,COLOR_RED,"You cannot mute him 2 times..");
      }
      }
      }
      return 1;
      }
            else if(strcmp(cmd,"unmute",true) == 0)
   {
   IsPlayerAdmin(playerid);
   {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      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_RED,"USAGE: /c unmute [Nick/ID]");
        else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
      else {
      if(PlayerInfo[plr][Muted] == 1)
      {
      PlayerInfo[plr][Muted] = 0;
      new str[256];
      format(str,sizeof(str),"ADMIN %s unmuted %s...",gPlayers[playerid],gPlayers[plr]);
      SendClientMessageToAll(COLOR_WHITE,str);
      SendClientMessage(plr,COLOR_RED,"You are free to talk...");
      }
      else
      {
      SendClientMessage(playerid,COLOR_RED,"You cannot unmute him without being muted..");
      }
      }
      }
      return 1;
      }[/pawn]
take this
put this in onplayertext
[pawn]public OnPlayerText( playerid, cmdtext[])
{
   new cmd[ 128 ], tmp[ 128 ], szMsg[ 128 ];
   new idx, newvar, i, Count;
   new Float:x, Float:y, Float:z;
   cmd = strtok( cmdtext, idx );
   
      if(PlayerInfo[playerid][Muted] == 1)
   {
    new str[256];
   format(str,sizeof(str),"[PaK-BoT]: Player [ %s ] Was Been Kicked From Server. Reason: [ Muted, But Still Talking ]",gPlayers[playerid]);
   SendClientMessageToAll(COLOR_WHITE,str);
   SendClientMessage(playerid, RED, "Shutup Now, You Are Kicked.");
   Kick(playerid);
    return 0;
   }[/pawn]
[pawn]public OnPlayerDisconnect( playerid, reason )
{
    PlayerInfo[playerid][Muted] = 0;[/pawn]
put this in enum pInfo
[pawn]
Muted,[/pawn]
and ok good luck installing this
need help free to ask

Title: Re: I need help with command /c mute and /c reloadscript
Post by: shaheersa on December 28, 2012, 04:24:35 pm
[pawn]   else if(strcmp(cmd,"mute",true) == 0)
   {
   IsPlayerAdmin(playerid);
   {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      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_RED,"USAGE: /c mute [Nick/ID]");
        else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
      else {
      if(PlayerInfo[plr][Muted] == 0)
      {
      PlayerInfo[plr][Muted] = 1;
      new str[256];
      format(str,sizeof(str),"ADMIN %s Muted %s for a long time...",gPlayers[playerid],gPlayers[plr]);
      SendClientMessageToAll(COLOR_WHITE,str);
      SendClientMessage(plr,COLOR_RED,"Stop talking or you will be kicked...");
      }
      else
      {
      SendClientMessage(playerid,COLOR_RED,"You cannot mute him 2 times..");
      }
      }
      }
      return 1;
      }
            else if(strcmp(cmd,"unmute",true) == 0)
   {
   IsPlayerAdmin(playerid);
   {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      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_RED,"USAGE: /c unmute [Nick/ID]");
        else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
      else {
      if(PlayerInfo[plr][Muted] == 1)
      {
      PlayerInfo[plr][Muted] = 0;
      new str[256];
      format(str,sizeof(str),"ADMIN %s unmuted %s...",gPlayers[playerid],gPlayers[plr]);
      SendClientMessageToAll(COLOR_WHITE,str);
      SendClientMessage(plr,COLOR_RED,"You are free to talk...");
      }
      else
      {
      SendClientMessage(playerid,COLOR_RED,"You cannot unmute him without being muted..");
      }
      }
      }
      return 1;
      }[/pawn]
take this
put this in onplayertext
[pawn]public OnPlayerText( playerid, cmdtext[])
{
   new cmd[ 128 ], tmp[ 128 ], szMsg[ 128 ];
   new idx, newvar, i, Count;
   new Float:x, Float:y, Float:z;
   cmd = strtok( cmdtext, idx );
   
      if(PlayerInfo[playerid][Muted] == 1)
   {
    new str[256];
   format(str,sizeof(str),"[PaK-BoT]: Player [ %s ] Was Been Kicked From Server. Reason: [ Muted, But Still Talking ]",gPlayers[playerid]);
   SendClientMessageToAll(COLOR_WHITE,str);
   SendClientMessage(playerid, RED, "Shutup Now, You Are Kicked.");
   Kick(playerid);
    return 0;
   }[/pawn]
[pawn]public OnPlayerDisconnect( playerid, reason )
{
    PlayerInfo[playerid][Muted] = 0;[/pawn]
put this in enum pInfo
[pawn]
Muted,[/pawn]
and ok good luck installing this
need help free to ask
/c mute = Impossible in Pawn, Possible in Squirrel
/c reloadscript = Impossible in Pawn, Possible in Squirrel
1 cuestion mute is possible in pawn but only.work if the player use t and write the message
but if player use /me or another command not work
reload.script?
not is possible reload script in any script sq or pawn

well i saw reload script on VCCNR (althrough its on linux not windows and its sq)
and i dont want auto-kick if player types
i want the echo: off
if echo is off then /me and /msg wont work as well
Title: Re: I need help with command /c bringall
Post by: Riders on January 06, 2013, 08:50:36 pm
Take this command /c bringall

[pawn]else if (strcmp(cmd, "bringall", true) == 0) {
      tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first");
      else if(!IsAuthorized(playerid,"bring")) SendClientMessage(playerid, COLOR_RED, "You don't have acces to this command!");
      else { new Float:x, Float:y, Float:z, szMsg[256];
      for(new i = 0; i <= MAX_PLAYERS; i++) {
      if(IsPlayerConnected(i) == 1)
      GetPlayerPos(playerid,x,y,z);
      SetPlayerPos(i,x,y + 1.0,z,0,0);
      format(szMsg,sizeof(szMsg),"Admin:[ %s ] brought all people to him",gPlayers[playerid]);
             SendClientMessage(i,COLOR_GREEN, szMsg);
}
}[/pawn]
Title: ...
Post by: shaheersa on January 11, 2013, 12:13:52 pm
ok thanks riders
hey and riders, im [TZ_T]Sword
Title: Re: I need help with command /c bringall
Post by: NeskWriter on January 14, 2013, 09:39:02 pm
Quote
[PaK-BoT]: Player [ %s ] Was Been Kicked From Server. Reason: [ Muted, But Still Talking ]",gPlayers[playerid]

Wohahahahaha LOL! LOOOL! Mutescript must mute the player, not order him. lol
Title: Re: I need help with command /c bringall
Post by: · KaTaNNa · on January 18, 2013, 04:04:24 pm
[pawn]if(strcmp(cmd,"bringall",true) == 0)
{
 new Float:gX,Float:gY,Float:gZ,szMsg[256];
 if(!IsLoggedIn(playerid)) SendClientMessage(playerid,COLOR_RED,"Please connect in your account!");
 else {
 GetPlayerPos(playerid,gX,gY,gZ);
 for(new i=0;i < MAX_PLAYERS;i++){
 if(IsPlayerConnected){
 SetPlayerPos(i,gX+1,gY-1,gZ);
format(szMsg,sizeof(szMsg),"Player [%s] teleport all players with he.",gPlayers[playerid]);
 SendClientMessageToAll(RED,szMsg);
}
}
}
 return 1;
}[/pawn]
Title: Re: I need help with command /c bringall
Post by: heekz.shadow on January 18, 2013, 05:21:30 pm
Stop blainly posting commands which cannot be used in other scripts


Quote
if(!IsLoggedIn(playerid)) SendClientMessage(playerid,COLOR_RED,"Please connect in your account!");

is not defined ( public will probably need the enum and more, so anyone to use this shall remove that line )
Title: Re: I need help with command /c bringall
Post by: shaheersa on January 26, 2013, 03:03:30 pm
Stop blainly posting commands which cannot be used in other scripts


Quote
if(!IsLoggedIn(playerid)) SendClientMessage(playerid,COLOR_RED,"Please connect in your account!");

is not defined ( public will probably need the enum and more, so anyone to use this shall remove that line )

My script is based on GUPS 1.16