Author Topic: Please Help Me!  (Read 8818 times)

0 Members and 1 Guest are viewing this topic.

Offline RasikhQadeer

  • Street Thug
  • *
  • Posts: 49
  • Hero_Great! The Great Scripter!
    • View Profile
Please Help Me!
« on: December 25, 2011, 06:44:55 am »
Help Me I Have This Mute cmd look: if(strcmp(cmd,"mute",true) == 0)
   {
   if(IsPlayerAdmin(playerid))
   {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      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(IsMuted[plr] == 0)
      {
      IsMuted[plr];
      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)
   {
   if(IsPlayerAdmin(playerid))
   {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      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(IsMuted[plr] == 1)
      {
      IsMuted[plr] = 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;
      }

and onplayertext: if(IsMuted[playerid] == 1)
   {
    new str[256];
   format(str,sizeof(str),"%s was been kicked for revealing the bannana from his mouth..",gPlayers[playerid]);
   SendClientMessageToAll(COLOR_WHITE,str);
   Kick(playerid);
    return 0;
   }
   }
   return 1;

but the problem is that the server does not kick him??? why??? :-\

Offline Ankit

  • Street Thug
  • *
  • Posts: 29
    • View Profile
Re: Please Help Me!
« Reply #1 on: December 25, 2011, 07:27:00 am »
Try Adding This
[pawn]new IsMuted[MAX_PLAYERS];
new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];[/pawn]
at the top of script
« Last Edit: December 25, 2011, 07:29:06 am by Ankit »
Name-Ankit Sharma
Age- 10
Location-India
WorkGroup:Small player and Scripter

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: Please Help Me!
« Reply #2 on: December 25, 2011, 04:23:33 pm »
You dont even define when the player talk...
[pawn]
public OnPlayerText(playerid, cmdtext[])
{
if(Muted][playerid] == 1)
   {
    new str[256];
   format(str,sizeof(str),"%s ha sido kickeado por hablar mientras ha sido mandado a                   callar..",gPlayers[playerid]);
   SendClientMessageToAll(COLOR_YELLOW,str);
   Kick(playerid);
    return 0;
      }[/pawn]

PD: I did this simple middle script to you cuz mine is too diferent, my PAWN is in spanish, lol.
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline RasikhQadeer

  • Street Thug
  • *
  • Posts: 49
  • Hero_Great! The Great Scripter!
    • View Profile
Re: Please Help Me!
« Reply #3 on: December 27, 2011, 12:06:46 pm »
i have defined isplayermuted but not the second and yes i have put the fucktion!

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Please Help Me!
« Reply #4 on: December 27, 2011, 12:33:31 pm »
Atleast, give me some credits ( or to aXXo lol ).


 Top :

[pawn] enum Info
{
   Muted
}[/pawn]

[pawn]new PlayerInfo[MAX_PLAYERS][Info];[/pawn]

 On Player Disconnect:

[pawn]   PlayerInfo[playerid][Muted] = 0;[/pawn]

 On Player Connect:

[pawn]new PlayerInfo[MAX_PLAYERS][Info];[/pawn]

The command :

[pawn]      else if(strcmp(cmd,"mute",true) == 0)
   {
   if(IsPlayerAdmin(playerid))
   {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      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 two times..");
      }
      }
      }
      return 1;
      }[/pawn]

The unmute Command

   [pawn]            else if(strcmp(cmd,"unmute",true) == 0)
   {
   if(IsPlayerAdmin(playerid))
   {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      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]

On Player Text:

[pawn]   if(PlayerInfo[playerid][Muted] == 1)
   {
    new str[256];
   format(str,sizeof(str),"%s was been kicked for revealing the bannana from his mouth..",gPlayers[playerid]);
   SendClientMessageToAll(COLOR_WHITE,str);
   Kick(playerid);
    return 0;
   }
[/pawn]
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline Saif

  • Street Thug
  • *
  • Posts: 13
    • View Profile
Re: Please Help Me!
« Reply #5 on: December 28, 2011, 11:19:57 am »
yessssss this work  :)
nice shadow

Offline RasikhQadeer

  • Street Thug
  • *
  • Posts: 49
  • Hero_Great! The Great Scripter!
    • View Profile
Re: Please Help Me!
« Reply #6 on: December 28, 2011, 04:12:15 pm »
E:\FCV5~1.0\GAMEMO~1\FC.pwn(134) : warning 219: local variable "PlayerInfo" shadows a variable at a preceding level
E:\FCV5~1.0\GAMEMO~1\FC.pwn(134) : error 017: undefined symbol "Info"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(134) : error 009: invalid array size (negative or zero)
E:\FCV5~1.0\GAMEMO~1\FC.pwn(161) : error 017: undefined symbol "CompariseIp"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(177) : error 017: undefined symbol "StatusTag"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(277) : error 017: undefined symbol "DecPlayerHandCash"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(278) : error 017: undefined symbol "IncPlayerDeaths"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(294) : error 017: undefined symbol "IncPlayerHandCash"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(295) : error 017: undefined symbol "IncPlayerKills"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(299) : error 017: undefined symbol "DecPlayerHandCash"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(300) : error 017: undefined symbol "IncPlayerDeaths"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(351) : error 017: undefined symbol "LoadSkins"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(352) : error 017: undefined symbol "LoadSpawnCharacters"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(353) : error 017: undefined symbol "LoadVehicles"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(354) : error 017: undefined symbol "LoadPickups"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(355) : error 017: undefined symbol "SetServerConfiguration"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(371) : error 017: undefined symbol "InitWepList"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(393) : error 017: undefined symbol "IsLoggedIn"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(401) : error 017: undefined symbol "encrypt"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(424) : error 017: undefined symbol "IsRegistered"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(425) : error 017: undefined symbol "IsLoggedIn"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(430) : error 017: undefined symbol "encrypt"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(448) : error 017: undefined symbol "UpDateFile"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(449) : error 017: undefined symbol "UpDateFile"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(452) : error 017: undefined symbol "StatusTag"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(482) : error 017: undefined symbol "UpDateFile"
E:\FCV5~1.0\GAMEMO~1\FC.pwn(493) : error 017: undefined symbol "FindPlayerIDFromString"

Compilation aborted.Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase


26 Errors.

I removed all the previous mute cmd texts for new after i carefuly removed the previous mute cmd i wated to compile it for backup and this hapen to me ;(

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Please Help Me!
« Reply #7 on: December 29, 2011, 05:12:13 am »
Lol.... The script Shadow gave is for GUPS.

Edit: SOrry, its your script problem...
I'm beginning to feel like a Lag God, Lag God

Offline Saif

  • Street Thug
  • *
  • Posts: 13
    • View Profile
Re: Please Help Me!
« Reply #8 on: December 29, 2011, 10:30:18 am »
oh  :o

Offline RasikhQadeer

  • Street Thug
  • *
  • Posts: 49
  • Hero_Great! The Great Scripter!
    • View Profile
Re: Please Help Me!
« Reply #9 on: January 04, 2012, 04:44:23 pm »
Can SomeOne make me a filterscript for that cuz its not taing with gamemode!

Offline Morphine

  • Made Man
  • ***
  • Posts: 109
    • View Profile
Re: Please Help Me!
« Reply #10 on: January 04, 2012, 04:54:47 pm »
Shadow, I know I'm not the one to judge but what you're doing isn't helpful at all. You could try and tell people what is wrong with their commands before presenting alternatives that they'll lazily copy and never learn from. People ask for help to understand, not to memorise.
« Last Edit: January 04, 2012, 05:00:38 pm by Morphine »

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: Please Help Me!
« Reply #11 on: January 04, 2012, 05:22:18 pm »
Well man this i made for you!

  ;D

http://www.megaupload.com/?d=ZLB4MMPA
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline RasikhQadeer

  • Street Thug
  • *
  • Posts: 49
  • Hero_Great! The Great Scripter!
    • View Profile
Re: Please Help Me!
« Reply #12 on: January 04, 2012, 06:35:20 pm »
I wont use it and no thx cuz showing your self too good that is made by shadow and change the credits so SO easily no no baby! i can convert .amx's to .pwn wait and watch Ha! nice try! 8)

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: Please Help Me!
« Reply #13 on: January 04, 2012, 07:17:31 pm »
MOTHER FUCKER NOOBISH

See again and talking shit if you dont know how to  read.

I only putted By dilson alone y kicked.

But in other sides i putto by Dilson and Shadow But i will delete it fucking noob
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline Leeter

  • Street Thug
  • *
  • Posts: 10
    • View Profile
Re: Please Help Me!
« Reply #14 on: January 05, 2012, 04:03:53 am »
dilson you needa to chill

your problem is that you copy & pasted, but didnt do it well.. you need to define the variables to keep em running.