Vice City Multiplayer

General Discussion => Support => Topic started by: Fuzzy168 on May 18, 2011, 06:24:05 am

Title: My Server Script Help
Post by: Fuzzy168 on May 18, 2011, 06:24:05 am
I will ask question I need help with here about my server.

1. How do I do welcome messages?

2. How do I edit commands with !

3. How do I edit a spawning character weapons and name?

I hope all this question could be answered.

[More to come]
Title: Re: My Server Script Help
Post by: asad3man on May 18, 2011, 07:19:51 am
i can tell u first 2 and 3rd is hard for me i m new and also finiding 3rd one

1.How to add welocme msg.. "OnPlayerconnect"

add this line
[pawn]GameTextForPlayer(playerid,"WELCOME MSG HERE",5000,5);[/pawn]

2.For commands using !
goto "OnPlayerText" dont goto OnPlayerCommands

and type some like this if u want !info commands u will type this

[pawn]else if (strcmp(cmd, "!info", true) == 0)
   {
   tmp = strtok(cmdtext, idx);
      if (!strlen(tmp)) {
               SendClientMessage(playerid, COLOR_ORANGE, "Pakistani Killers Mode Scripts");
            SendClientMessage(playerid, COLOR_ORANGE, "Also u can Join Clan goto ");
            SendClientMessage(playerid, COLOR_ORANGE, "http://pakistanikillersclan.net76.net");
      }
      return 1;
   }[/pawn]



as i told i dont know third one so sorry for that.......
Title: Re: My Server Script Help
Post by: StriKe on May 18, 2011, 07:22:45 am
I think 3rd one should be how to add new characters and weapons?

http://famp.ru/wiki/AddPlayerClass
Title: Re: My Server Script Help
Post by: asad3man on May 18, 2011, 07:27:45 am
yes strike u r right it is for u helped me now i can know it  thanx strike
Title: Re: My Server Script Help
Post by: StriKe on May 18, 2011, 07:33:37 am
For the coordinates X,Y,Z. Go ingame and type /s to save the position of the class.

You can find the list of saved coordinates in a txt called "vc-mp_saved_coords" in your GTA VC  Directory.
Title: Re: My Server Script Help
Post by: asad3man on May 18, 2011, 07:39:12 am
a problem occured when i put it to pawn then starts the game i chnaged th eplayer skins id then it is giving construction worker 2 times
Title: Re: My Server Script Help
Post by: Fuzzy168 on May 18, 2011, 03:44:29 pm
Thanks asad3man for no.1 but I don't understand your no.2 answer. Could you explain your answer? No.3, GUPS gives the player with weapon. I wanna know how to remove those and how in I actually change the name of the character, not add another character.
Title: Re: My Server Script Help
Post by: asad3man on May 18, 2011, 04:08:50 pm
in the 3rd n#
i gave example of !info command
u can add !admin commands !forum commands
just change where it is writen !info
and change the next line which s written "Pakistani Killers"
if u write "Hello i am admin" then it says Hello i am admin instead if Pakistani killer if u write !ADMIN
Title: Re: My Server Script Help
Post by: Fuzzy168 on May 18, 2011, 04:22:55 pm
Ok I understand. On the other side, I was actually meaning how to change the ! to something like /c. Anyway that really help too.
Title: Re: My Server Script Help
Post by: asad3man on May 18, 2011, 04:25:52 pm
if u want to /c commands then u can do it goto OnPalyerCommand and just type info on box not /c info

NOTE :- That is an only Example
Title: Re: My Server Script Help
Post by: Fuzzy168 on May 18, 2011, 04:29:41 pm
HOW?
Title: Re: My Server Script Help
Post by: asad3man on May 18, 2011, 04:34:57 pm
in pawno goto this place OnPlayerCommandText and then write like this but wite only command like eg info admin  etc :X
Title: Re: My Server Script Help
Post by: Fuzzy168 on May 18, 2011, 05:11:22 pm
could you show me the pawn?
Title: Re: My Server Script Help
Post by: asad3man on May 18, 2011, 05:45:00 pm
no
i am too lazy
Title: Re: My Server Script Help
Post by: Fuzzy168 on May 18, 2011, 06:51:29 pm
Asad,i understand what you mean just the box part. Could you explain that to me?
Title: Re: My Server Script Help
Post by: asad3man on May 18, 2011, 06:58:33 pm
BOX oooooohh here is no box means that "blblablbablabalbala"
Title: Re: My Server Script Help
Post by: Fuzzy168 on May 18, 2011, 07:21:56 pm
Someone tell me how to add a command.
Title: Re: My Server Script Help
Post by: stormeus 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
Title: Re: My Server Script Help
Post by: Fuzzy168 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..
Title: Re: My Server Script Help
Post by: stormeus 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?
Title: Re: My Server Script Help
Post by: Fuzzy168 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!!
Title: Re: My Server Script Help
Post by: BIG[H] 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..
Title: Re: My Server Script Help
Post by: Prototype on May 20, 2011, 10:18:28 am
i need this option also
Title: Re: My Server Script Help
Post by: stormeus 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:

Here's a ten-level admin system, as well:
Which I feel should only be used for large servers or servers that require more moderation.
Title: Re: My Server Script Help
Post by: Morphine 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
Title: Re: My Server Script Help
Post by: Fuzzy168 on May 20, 2011, 07:16:45 pm
Thanks Big[H], stormeus and Morphine!! That really helped.
Title: Re: My Server Script Help
Post by: stormeus 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.
Title: Re: My Server Script Help
Post by: Fuzzy168 on May 21, 2011, 08:48:16 am
Quote
Hp Auto Ban system xD
Where should I put it?
Title: Re: My Server Script Help
Post by: yazeen 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
Title: Re: My Server Script Help
Post by: Fuzzy168 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..??