Author Topic: My Server Script Help  (Read 10707 times)

0 Members and 1 Guest are viewing this topic.

Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: My Server Script Help
« Reply #15 on: May 18, 2011, 06:58:33 pm »
BOX oooooohh here is no box means that "blblablbablabalbala"

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: My Server Script Help
« Reply #16 on: May 18, 2011, 07:21:56 pm »
Someone tell me how to add a command.
I'm beginning to feel like a Lag God, Lag God

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: My Server Script Help
« Reply #17 on: May 19, 2011, 03:39:35 am »
Usually, scripts have an OnPlayerCommandText function somewhere in it. You might have something like this:
[pawn]
if(strcmp(cmd, "mycommand", true) == 0)
{
    // A bunch of code
}
[/pawn]

Under that, you would add this:
[pawn]
else if(strcmp(cmd, "anothercommand", true) == 0)
{
    // Your code here
}
[/pawn]

Which would add a command which would be used by typing /c anothercommand
Do not PM me for support.




Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: My Server Script Help
« Reply #18 on: May 19, 2011, 06:31:48 am »
I don't know how to use it.. I always get error message when compiling. I wanted to do a command for /c info or !info..
« Last Edit: May 19, 2011, 06:38:50 am by Fuzzy168 »
I'm beginning to feel like a Lag God, Lag God

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: My Server Script Help
« Reply #19 on: May 19, 2011, 01:15:37 pm »
I don't know how to use it.. I always get error message when compiling. I wanted to do a command for /c info or !info..

What's the error and can you post the code you added?
Do not PM me for support.




Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: My Server Script Help
« Reply #20 on: May 20, 2011, 07:24:09 am »
New Question Added!!

1. Answered by asad3man
2. Answered by asad3man and stormeus
3. Answered by Strike


NEW QUESTIONS!!

4. How do I change the colour?
[pawn]   else if (strcmp(cmd, "setspeed", true) == 0) {
      tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!IsPlayerCommandLevel(playerid,"setspeed")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
      else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c setspeed [Value]");
      else {
          new szMsg[256];
         format(szMsg,sizeof(szMsg),"Admin %s changed setspeed to:[ %d ]",gPlayers[playerid],strval(tmp));
         SendClientMessage(playerid,COLOR_GREEN,szMsg);
         SetGamespeed(strval(tmp));
      }
      return 1;[/pawn]
5. Is there any code to track HACKER?
6. Can anyone suggest any ADMIN LEVEL names?

More to come!!
I'm beginning to feel like a Lag God, Lag God

Offline BIG[H]

  • Made Man
  • ***
  • Posts: 159
  • Sight of light
    • View Profile
Re: My Server Script Help
« Reply #21 on: May 20, 2011, 08:54:21 am »
Hp Auto Ban system xD

Quote
public OnPlayerArmoursys()
{
for(new playerid = 0; playerid <= MAX_PLAYERS; playerid++) {
        if(IsPlayerConnected(i) == 1) {
      new MSN[256], Float:Armour; GetPlayerArmour(playerid,Armour);
        if (Armour >= 101)
      {
      format(MSN,256,">> Auto-Ban: %s - Reason: [Armour Hax]",gPlayers[playerid]);
      format(MSN,256,">> Auto-Ban: %s - Reason: [Armour Hax]",gPlayers[playerid]);
      SendToIRC(MSN);
                SendClientMessageToAll(BLUE,MSN);
                SendClientMessage(playerid,COLOR_GREEN,"Error: No Armour allowed");

               new IP[256],inf[256];
      GetPlayerIp(playerid,IP,256);
       format(inf,256,"1 %s Server Armour-hax",gPlayers[playerid]);//info to archive player banned
   //     dini_Set("/Banneds/Banlist.ini",IP,inf);//send to ban list
    //    dini_Set("/Banneds/PlayerBanlist.ini",gPlayers[playerid],IP);//send to player and IP
//Plrinfo[playerid][kicking] = 1;
//Plrinfo[playerid][adminfreezed] = 1;;
      SetTimer("kickinginsec",5000,0);
      TogglePlayerControllable(playerid,0);
format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
                format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
                format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
                format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
                format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
              format(MSN,256,"~y~>> ~w~Banned ~y~>> ",gPlayers[playerid];
              GameTextForPlayer(playerid,MSN);
         Plrinfo[playerid][kicking] = 1;
           format(MSN,256,"Forum url");
         GameTextForPlayerBottom(playerid,MSN);
               }
}
 return 1;
}
public OnPlayerhpsys()
{
for(new playerid = 0; playerid <= MAX_PLAYERS; playerid++) {
        if(IsPlayerConnected(i) == 1) {
new MSN[256], Float:Health; GetPlayerHealth(playerid,Health);
        if (Health >= 101)
      {
      format(MSN,256,">> Auto-Ban: %s - Reason: [health Hax]",gPlayers[playerid]);
   format(MSN,256,">> Auto-Ban: %s - Reason: [health Hax]",gPlayers[playerid]);
   SendToIRC(MSN);
                SendClientMessageToAll(BLUE,MSN);
                SendClientMessage(playerid,COLOR_GREEN,">>pm>>  not more than 100 hp not allowed");

               new IP[256],inf[256];
      GetPlayerIp(playerid,IP,256);
       format(inf,256,"1 %s Auto-Admin-Server health-hax",gPlayers[playerid]);//info to archive player banned
        dini_Set("/Banneds/Banlist.ini",IP,inf);//send to ban list
        dini_Set("/Banneds/PlayerBanlist.ini",gPlayers[playerid],IP);//send to player and IP
Plrinfo[playerid][kicking] = 1;
Plrinfo[playerid][adminfreezed] = 1;
                  Plrinfo[playerid][kicking] = 1;
      SetTimer("kickinginsec",5000,0);

      TogglePlayerControllable(playerid,0);
format(MSN,256,">>%s Post Your Ban Appeal At %s ",gPlayers[playerid],asd);
                SendClientMessage(playerid,BLUE,MSN);
                format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
                format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
                format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
                format(MSN,256,">>%s Post Your Ban Appeal At Forum url ",gPlayers[playerid]);
                SendClientMessage(playerid,BLUE,MSN);
              format(MSN,256,"~y~>> ~w~Banned ~y~>>",gPlayers[playerid]);
              GameTextForPlayer(playerid,MSN,1000000,5);
         Plrinfo[playerid][kicking] = 1;
           format(MSN,256,"Forum url");
         GameTextForPlayerBottom(playerid,MSN);

}
}
 return 1;
}
}

Add this in gamemodeinit

Quote
SetTimer("OnPlayerArmoursys",500,1);// Checks player every half second and if health more than 100 give's instant BAn edit ban thing to your path
SetTimer("OnPlayerhpsys",500,1);
:D

needs some edit..
Outdoor city server Administrator, FS server owner!

Offline Prototype

  • Street Thug
  • *
  • Posts: 11
    • View Profile
Re: My Server Script Help
« Reply #22 on: May 20, 2011, 10:18:28 am »
i need this option also

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: My Server Script Help
« Reply #23 on: May 20, 2011, 01:49:19 pm »
4. How do I change the colour?
[pawn]   else if (strcmp(cmd, "setspeed", true) == 0) {
      tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!IsPlayerCommandLevel(playerid,"setspeed")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
      else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c setspeed [Value]");
      else {
          new szMsg[256];
         format(szMsg,sizeof(szMsg),"Admin %s changed setspeed to:[ %d ]",gPlayers[playerid],strval(tmp));
         SendClientMessage(playerid,COLOR_GREEN,szMsg);
         SetGamespeed(strval(tmp));
      }
      return 1;[/pawn]

In the functions, where it says COLOR_RED or COLOR_GREEN, you can change these to something like COLOR_YELLOW or COLOR_BLUE, but you need to define their values. Here are a bunch of colors from GUPS.
[pawn]
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x04A36BFF
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define RED 0xF0182DFF
#define GREEN 0x0FCD18FF
#define WHITE 0xFFFDFDFF
#define ORANGE 0xF6A113FF
#define PURPLEE 0xD22FBCFF
#define OriginalGreen 0x04A36BFF
#define BLUE 0x377DFFFF
[/pawn]

Quote
5. Is there any code to track HACKER?
It would take quite some time to make a fully-functional anti-hack system that doesn't kick actual people. You'll just have to ban them yourself for now, unless someone else would like to post their own scripts.

Quote
6. Can anyone suggest any ADMIN LEVEL names?

I use a five-level admin system like this:
  • Member
  • Moderator
  • Administrator
  • Lead Administrator
  • Owner

Here's a ten-level admin system, as well:
  • Member
  • Helper
  • Lead Helper
  • Moderator
  • Lead Moderator
  • Administrator
  • Super Administrator
  • Lead Administrator
  • Scripter
  • Owner
Which I feel should only be used for large servers or servers that require more moderation.
Do not PM me for support.




Offline Morphine

  • Made Man
  • ***
  • Posts: 109
    • View Profile
Re: My Server Script Help
« Reply #24 on: May 20, 2011, 02:59:18 pm »
I use a five-level admin system like this:
  • Member
  • Moderator
  • Administrator
  • Lead Administrator
  • Owner


Wasn't it Member, Mod, Admin and Owner? Or we have a new admin system introduced in release 5? :P

Well anyway - the easiest way to group the staff would be this.
Level 1 - Member (obviously)
Level 2 - Moderator
Level 3 - Administrator
Level 4 - Server Owner

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: My Server Script Help
« Reply #25 on: May 20, 2011, 07:16:45 pm »
Thanks Big[H], stormeus and Morphine!! That really helped.
I'm beginning to feel like a Lag God, Lag God

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: My Server Script Help
« Reply #26 on: May 20, 2011, 10:31:50 pm »
Wasn't it Member, Mod, Admin and Owner? Or we have a new admin system introduced in release 5? :P

Well anyway - the easiest way to group the staff would be this.
Level 1 - Member (obviously)
Level 2 - Moderator
Level 3 - Administrator
Level 4 - Server Owner

I dunno what I'm thinking, lol. No, it didn't change in r5.
Do not PM me for support.




Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: My Server Script Help
« Reply #27 on: May 21, 2011, 08:48:16 am »
Quote
Hp Auto Ban system xD
Where should I put it?
I'm beginning to feel like a Lag God, Lag God

yazeen

  • Guest
Re: My Server Script Help
« Reply #28 on: May 23, 2011, 10:42:44 am »
Quote
Hp Auto Ban system xD
Where should I put it?

Anywhere in your script not in middle of OnplayerConnect or OnplayerCommandText or any just add it on bottom of the script is fine. then Add the timers in Gamemodeint.. Hope it helps

and add scripts in OnplayerText for !commands and add scripts on onplayercommandtext for /c commands

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: My Server Script Help
« Reply #29 on: May 26, 2011, 04:59:55 am »
I use a five-level admin system like this:
  • Member
  • Moderator
  • Administrator
  • Lead Administrator
  • Owner


Wasn't it Member, Mod, Admin and Owner? Or we have a new admin system introduced in release 5? :P

Well anyway - the easiest way to group the staff would be this.
Level 1 - Member (obviously)
Level 2 - Moderator
Level 3 - Administrator
Level 4 - Server Owner
So how do I change it? I have another question. How to add pickups. Like in argo, when you pickup the pickup, some message will appear in the chat. How do I do that..??
I'm beginning to feel like a Lag God, Lag God