• Welcome to Vice City Multiplayer.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Madara

#1
ShowRoom (pawn) / Kick to High Ping by Madara
March 27, 2011, 11:15:54 PM
Hi all, today i will show how to create a function which will serve to "kick"a player with high ping.

First, define a "enum" where will be the ticket send player:

enum playerInfo
{
   CheckPing,
}


Now define a "new",which refers to the "enum" and whether to use the ticket "CheckPing":
NOTE: These last two should go to the top of your script.

new SpInfo[MAX_PLAYERS][playerInfo];

Now, get to "public OnGameModeInt()" and put a timer wich is function to check player ping:

public OnGameModeInit()
{
SetTimer("AntiLaag",500,1);

return 1;
}


Follow this, make function check player ping:

public AntiLaag()
{
   for(new i = 0; i <= MAX_PLAYERS; i++) {
   new sendmsn[256],plr = FindPlayerIDFromString(gPlayers[i]);

if (SpInfo[plr][CheckPing] == 1 && GetPlayerPing(plr) >= 1000) {
   format(sendmsn,256, "Server - Kicked: %s, ID: %d, Reason:[ High Ping - %d ].",gPlayers[plr],plr,GetPlayerPing(plr));
           SendClientMessageToAll(0x377DFFFF,sendmsn);
   Kick(plr);
   }
}
}


Now, get to "public OnPlayerSpawn(playerid,classid,teamid)", and put ticket to send value 1, and thus in the function "public AntiLaag()", check if have value 1:

public OnPlayerSpawn(playerid,classid,teamid)
{
       SpInfo[playerid][CheckPing] = 1;

return 1;
}


And put also ticket but with value 0 when a player leave server, this is in "OnPlayerDisconnect(playerid, reason)":

public OnPlayerDisconnect(playerid, reason)
{
SpInfo[playerid][CheckPing] = 0;

return 1;
}


NOTE: if not have define "gPlayers", you need define, also if not have "FindPlayerIDFromString".

I hope something will help them in any problems please tell me.

Credits: YO ( Madara ).

Greetings  ;)
#2
ShowRoom (pawn) / Kick to Invalid Nick by Madara
March 26, 2011, 09:52:57 PM
Hi all, today I will show you a code for those players who kick in your name contains numbers or characters that you want.


Fisrt make the code kick to invalid nick, this function find define characters or number:
public IsInvalidChar(c[])
{
if (strfind(c, "*", true) != -1 || strfind(c, "?", true) != -1 ||
   strfind(c, ":", true) != -1 || strfind(c, "<", true) != -1 ||
   strfind(c, ">", true) != -1 || strfind(c, "|", true) != -1 ||
   strfind(c, "/", true) != -1 || strfind(c, "@", true) != -1 ||
   strfind(c, "~", true) != -1 || strfind(c, "{", true) != -1 ||
   strfind(c, "}", true) != -1) return 1;
if (IsNumeric(c)) return 1;
       else return 0;
   return 1;
}


Now, make the code wich function is find in player name a number:
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++) {
    if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}


Follow the function "IsInvalidNick", make a function where kick player if contains number o defiene characters:
public NickPlayerChar(playerid)
{
if(IsInvalidChar(PlayerName(playerid))) {
  new str[256];
  format(str,256,">> Server Auto-Kick: %s, Razon:[ Nick Invalido ].", PlayerName(playerid));
  SendClientMessageToAll(0xFF00FF96,str);
  Kick(playerid);
}
}


To finish, usage the function "NickPlayerChar" and put in "OnplayerConnect", this's if the player when he is entering the server:

public OnPlayerConnect(playerid)
{
NickPlayerChar(playerid);
return 1;
}


Now define function consulte player name from id:

public PlayerName(playerid)
{
       new name[24];
GetPlayerName(playerid,name,24);
return name;
}


  - OPTION 2 -

If you can not put this function on the server, you can choose to download my filterscript InvalidNicks.

  DOWNLOAD:[FS]Invalid Nicks to Megaupload && [FS]Invalid Nicks to Mediafire

I hope you like this feature for future uses they want to give.

Credits: YO ( Madara ).

Greetings  ;)
#3
ShowRoom (pawn) / New Include "Madara.INC" by Madara
March 19, 2011, 09:00:44 PM
Hi all, today i come bringing me back I did include, as indeed he uses my server WarChiefs v1.0.

   DOWNLOAD:Madara.INC to Mediafire  &  Madara.INC to Megaupload
 
This function is installed on your Pawn, where is the folder includes, where are the others include; dutils, dudb, dini, etc. ..

This include contains:

- New way of sending messages, example:
 
  MessagePM(playerid,colour, text);
  MessagePMFormat(playerid,colour, text, consulte); -- > Example: MessagePMFormat(playerid,colour, "%s has joined server.",  PlayerName(playerid));
  MessageAll(colour, text);
  MessageAllFormat(colour, text, consulte); --> Example:   MessageAll(colour, "Auto-kick %s, ID %d - Reason:[ Bla Bla ].",PlayerName(playerid,playerid);

- New way of sending game text, example:

  TextBigPMFormat(playerid, game text, consulte); --> Example: TextBigPMFormat(playerid, "welcome %s to server", PlayerName(playerid));
  TextBigAllFormat(game text, consulte); --> Example: TextBigAllFormat("Rand Player: Find %s", PlayerName(playerid));
  BottomBigPMFormat(playerid, game text bottom, consulte); --> Too to TexBigPMFormat but in bottom text.
  BottomBigAllFormat(game text bottom, consulte); --> Too to TextBigAllFormat but in bottom
  MsgPMFormatEx(playerid, colour, text, game text);  --> Example:  MsgPMFormatEx(playerid, colour, "Hello!", "Hello");
  MsgAllFormatEx(colour,text,game text); --> Example: MsgAllFormatEx(colour, "hello all", "hello all");
  Among others ...

- Consulte model name of vehicle, but for this, need add vehicles first:

  AddVehicleServer(vehicleid, model, x, y, z, angle,colour1 ,colour2); <-- Need add vehicles in your server with that.
  GetVehicleModelID(vehicleid); <-- With this consulte  modelid of vehicleid.
  GetVehicleModelName(modelid); <-- With this consulte model name of modelid, exmaple: GetVehicleModeName(GetVehicleModelID(vehicleid));

- Consulte time server.
 
  GetTimeData() --> Result to use this function  "12:35 PM"
  GetDayDataFormat() -- > Result to use this function  "19/March/2011"
  GetDayData() --> Result to use this function "March 19, 2011"

- Consulte skin name.

  GetNameFromSkinID(skinid)

- Consulte modelid of pickupid, but for this, need add pickups first:

 AddPickupServer(pickupid, modelid, x, y, z)
 GetPickupModelID(pickupid) <-- Consulte Model ID From pickupid

- And a randplayer to selection a player.
 
  RandPlayer() <-- player selects a random server all

Among other utilities you can use in your server.

I hope you see, and for any questions or suggestions, please comment.

Credits: YO ( Madara ).

Greetings. ;)
#4
Many ask, how to make a LMS for my server?, well, here I show you a way to haer a man last Stading created by me.

First of all, define the locations used in the game last man standing, it will stop positions, but they better save their time and give them that I have.
new Float:RandInfoLMS[15][7] = { // MinX, MaxX, MinY, MaxY , X , Y , Z , Int
{-1102.2737,-1075.0229,1267.8066,1393.5516,-1094.28332519, 1307.67419433, 34.24106979},
{-1708.7883, -1540.6664, -524.5789, -463.3878, -1635.2369, -501.1630, 50.1828},
{-1013.4427, -924.8788, 698.5222, 777.5504, -969.2894, 743.3184, 57.2507},
{-833.6387, -754.4878, 806.6534, 855.1415, -804.1165, 815.6527, 11.0846},
{542.0474, 590.8376, -110.5802, -70.8055, 568.1187, -84.2334, 9.4397},
{91.7778, 167.5648, 329.0602, 357.0180, 128.2160, 343.1032, 19.1541},
{-44.6020, -27.4109, 1178.2372, 1213.4877, -37.6370, 1197.8688, 21.4526},
{-1200.9607, -1167.4662, -1349.8386, -1312.9932, -1183.3875, -1334.0931, 14.9360},
{-1107.7136, -1057.4801, -288.9542, -239.3820, -1081.9669, -262.2973, 20.4579},
{-1107.7972, -1069.2410, -634.8514, -594.0654, -1090.0913, -616.2128, 11.2534},
{-1003.6110, -955.4279, 96.3539, 142.3303, -978.6742, 119.9475, 9.2628},
{-998.5562, -902.6942, 369.7229, 427.0913, -954.6682, 397.8014, 11.2516},
{196.3628, 236.3812, -1297.0651, -1252.8628, 230.3235, -1266.7476, 20.1141},
{98.4118, 135.2352, -1340.5229, -1308.0060, 121.8333, -1328.8723, 4.4396},
{-18.8285, 27.5851, -949.9951, -927.9282, 4.2093, -941.0284, 16.1160}
};


Then we define another to be the same, but this will be the reward it received the game winner last man standing:
new RandRewardLMS[10][1] = {
{500},
{1500},
{3000},
{4500},
{6000},
{7500},
{9000},
{12500},
{16000},
{25000}
};


Now we will create two stored data enumerators, one will be to define a player, and other free information that will serve to guard the last man standing ticket:

enum LMSInfo
{
OnLMS,
LockLMS,
CountLMS,
Float:MinXS,
Float:MaxXS,
Float:MinYS,
Float:MaxYS,
Float:PosXS,
Float:PosYS,
Float:PosZS,
IntS,
RewS,
CDLMS,
WinnerS[256],
}

//And this:

enum playerInfoLMS
{
JoinLMS,
Float:pX,
Float:pY,
Float:pZ,
       LastVehicle,
}


Once employed these, we place the new letters that are combined with the enumeration of these two mentioned, remember, all this must go up:

new pInfoLMS[MAX_PLAYERS][playerInfoLMS];
new gLMS[LMSInfo], MSGLMS[256], LMS1;


After that, look for the "public OnPlayerDisconnect (playerid, reason)" and put it in an empty line, which can be used so that when a player leaves the server, and the full play the last man standing, you remove the ticket and decrease the number of players in the last man standing:

public OnPlayerDisconnect(playerid, reason)
{
       if (pInfoLMS[playerid][JoinLMS] == 1) {pInfoLMS[playerid][JoinLMS] = 0; DecLMSCount(1);}
return 1;
}


Now create the script! lms and! more besides join a checker who are playing the last man standing and how many are:

public OnPlayerText(playerid, cmdtext[])
{

   if (strcmp(cmd, "!lms", true) == 0) {
if(gLMS[OnLMS] == 1) SendClientMessage(playerid, 0x04A36BFF,"[Error] - Last Man Standing currently activated.");
else {
                    StarLMS();
}
return 1;
   }

   else if (strcmp(cmd, "!join", true) == 0) {
if(gLMS[OnLMS] == 0) SendClientMessage(playerid, 0x04A36BFF,"[Error] - Last Man Standing currently disabled.");
else if(pInfoLMS[playerid][JoinLMS] == 1) SendClientMessage(playerid, 0x04A36BFF,"[Error] - You are already in Last Man Standing.");
else if(gLMS[LockLMS] == 1) SendClientMessage(playerid, 0x04A36BFF,"[Error] - You can't enter the Last Man Standing.");
else {
    JoinPlayerLMS(playerid);
}
return 1;
   }

   else if (strcmp(cmd, "!playerslms", true) == 0) {
       new Count, i;
       for (i = 0; i <= MAX_PLAYERS; i ++) if(IsPlayerConnected(i) && pInfoLMS[i][JoinLMS] == 1) Count++;
       if (Count >= 1) {
                new bool:b = false;
                for (i = 0; i <= MAX_PLAYERS; i ++) if(IsPlayerConnected(i) && pInfoLMS[i][JoinLMS] == 1) {
                if(!b) {format(MSGLMS,256,"%s",PlayerName(i)); b = true;}
                else format(MSGLMS,256,"%s - %s",MSGLMS,PlayerName(i));
                }
}
if (Count >= 1) {format(MSGLMS,256, "Players in LMS: %s.",MSGLMS); SendClientMessageToAll(0x377DFFFF,MSGLMS); format(MSGLMS, 256, "Total players LMS: %d.",GetLMSCount()); SendClientMessageToAll(0x377DFFFF,MSGLMS);}
else SendClientMessageToAll(0x377DFFFF, "No players currently in LMS.");
return 1;
   }

   return 0;
}


Then we move into the public "OnPlayerDeath (playerid, killerid, reason, bodypart)," that there will a line when a player dies it decreases the number of players in lms and you take your ticket you have in combat:

public OnPlayerDeath(playerid, killerid, reason, bodypart)
{        
     if ( reason == reason ) {
         if (pInfoLMS[playerid][JoinLMS] == 1) {pInfoLMS[playerid][JoinLMS] = 0; DecLMSCount(1);}
     }
     return 1;
}


If you noticed, in the above commands:! lms and! join, there are two functions that are JoinPlayerLMS StarLMS and the first is to create all the data using defined at the outset, filled out the location of the combat and reward, and the second is to fill in data when active player! join and enter the battle, but the weapon is removed and temporarily frozen, remember that when they do new function using "public ", define the way down and without intervention from others.

public StarLMS()
{
   new rand1 = random(sizeof(RandInfoLMS)), rand2 = random(sizeof(RandRewardLMS));
   new Float:x, Float:y, Float:z, Float:MinX, Float:MaxX, Float:MinY, Float:MaxY;
   MinX = RandInfoLMS[rand1][0],MaxX = RandInfoLMS[rand1][1],MinY = RandInfoLMS[rand1][2],MaxY = RandInfoLMS[rand1][3];
   x = RandInfoLMS[rand1][4],y = RandInfoLMS[rand1][5],z = RandInfoLMS[rand1][6];
   gLMS[MinXS] = MinX, gLMS[MaxXS] = MaxX, gLMS[MinYS] = MinY, gLMS[MaxYS] = MaxY;
   gLMS[PosXS] = x, gLMS[PosYS] = y, gLMS[PosZS] = z, gLMS[RewS] = RandRewardLMS[rand2][0], gLMS[OnLMS] = 1;
   SetTimer("CloseJoinLMS",20000,0);
   SendClientMessageToAll(0x377DFFFF,"LMS Activate, type !join to enter, wait players [20 Seg.]");
   return 1;
}

public JoinPlayerLMS(playerid)
{
   new Float:x, Float:y, Float:z;
   SendClientMessage(playerid, 0x04A36BFF,"Joined to Last Man Standing, waiting more players...");
   GetPlayerPos(playerid,x,y,z);
   IncLMSCount(1);
   TogglePlayerControllable(playerid,0);
   ResetPlayerWeapons(playerid);
   format(MSGLMS,256,"%s",PlayerName(playerid));
   pInfoLMS[playerid][pX] = x, pInfoLMS[playerid][pY] = y, pInfoLMS[playerid][pZ] = z;
   pInfoLMS[playerid][JoinLMS] = 1;
   SetPlayerPos(playerid,gLMS[PosXS], gLMS[PosYS], gLMS[PosZS], 0,0);
   if (IsPlayerInAnyVehicle(playerid)) pInfoLMS[playerid][LastVehicle] = GetPlayerVehicleID(playerid);
   return 1;
}


Now add this as a timer function that the StarLMS, which closes the entrance to the LMS and deny entry to those who want to go putting! join, and also send the countdown to begin the fight:

public CloseJoinLMS()
{
   if (gLMS[CountLMS] == 0) {SendClientMessageToAll(0x377DFFFF, "LMS has closed because no players."); SetTimer("QuitBugLMS",1000,0);}
   if (gLMS[CountLMS] == 1) {SendClientMessageToAll(0x377DFFFF, "LMS has closed because need more players."); QuitPlayerLMS();}
   else if (gLMS[CountLMS] >= 2) {
                SendClientMessageToAll(0x377DFFFF, "LMS is now closed, you can't get at moment.");
                SendClientMessageToAll(0x377DFFFF, "Starting the game Last Man Standing.");
gLMS[LockLMS] = 1;
        SetTimer("CountLMS1", 1000, 0);
SetTimer("CountLMS2", 2000, 0);
  SetTimer("CountLMS3", 3000, 0);
SetTimer("CountLMS4", 4000, 0);
   }
   return 1;
}




public StarGameLMS()
{
   if (gLMS[CountLMS] == 0) {SendClientMessageToAll(0x377DFFFF, "LMS has ended because no players."); KillTimer(LMS1); SetTimer("QuitBugLMS",1000,0);}
   else if (gLMS[CountLMS] == 1) {SendClientMessageToAll(0x377DFFFF, "LMS has completed and a winner."); KillTimer(LMS1); SetTimer("InfoPlayerWinLMS",500,0); SetTimer("SendPlayerRewardLMS",1000,0);}
   else if (gLMS[CountLMS] >= 2) {
        for(new i = 0; i <= MAX_PLAYERS; i++) {
            new plr = FindPlayerIDFromString(PlayerName(i));
            if(pInfoLMS[plr][JoinLMS] == 1){
               if(!NeedPlayerInArea(plr,gLMS[MinXS],gLMS[MaxXS],gLMS[MinYS],gLMS[MaxYS])) {SetPlayerPos(plr,gLMS[PosXS], gLMS[PosYS], gLMS[PosZS], 0,0); GameTextForPlayerBottom(plr,"~h~re-join!");}
               else GameTextForPlayerBottom(plr,"\x10");
            }
}
}
return 1;
}




public QuitPlayerLMS()
{
   SetTimer("QuitBugLMS",2000,0);
   for(new i = 0; i <= MAX_PLAYERS; i++) {
       new plr = FindPlayerIDFromString(PlayerName(i));
       if(pInfoLMS[plr][JoinLMS] == 1){
          gLMS[LockLMS] = 0, gLMS[OnLMS] = 0, pInfoLMS[plr][JoinLMS] = 0;
          TogglePlayerControllable(plr,1);
          SetPlayerWeapon(plr,19,9999);
      SetPlayerWeapon(plr,22,9999);
      SetPlayerWeapon(plr,32,9999);
      DecLMSCount(1);
      if (pInfoLMS[plr][LastVehicle] >= 1) {PutDirectlyInVehicle(plr,pInfoLMS[plr][LastVehicle]); pInfoLMS[plr][LastVehicle] = 0;}
      else SetPlayerPos(plr,pInfoLMS[plr][pX],pInfoLMS[plr][pY],pInfoLMS[plr][pZ],0,0);
       }
   }
   return 1;
}




public QuitBugLMS()
{
   gLMS[LockLMS] = 0;
   gLMS[OnLMS] = 0;
   gLMS[CountLMS] = 0;
}



public InfoPlayerWinLMS()
{
   gLMS[LockLMS] = 0, gLMS[OnLMS] = 0, gLMS[CountLMS] = 0;
   for(new i = 0; i <= MAX_PLAYERS; i++) {
       new plr = FindPlayerIDFromString(PlayerName(i));
       if(pInfoLMS[plr][JoinLMS] == 1){
  format(MSGLMS,256,"%s",PlayerName(plr));
          gLMS[WinnerS] = MSGLMS;
          }
   }
   return 1;
}





public SendPlayerRewardLMS()
{
   new plr = FindPlayerIDFromString(gLMS[WinnerS]);
   format(MSGLMS,256,"~h~ LMS winner: ~o~%s",PlayerName(plr));
   GameTextForAll(MSGLMS);
   format(MSGLMS,256, "%s is the winner of LMS, Reward:$ %d.",PlayerName(plr),gLMS[RewS]);
   SendClientMessageToAll(0x377DFFFF,MSGLMS);
   GivePlayerMoney(plr,gLMS[RewS]); // <--- Here put u cash or type function use to send money player
   SetPlayerWeapon(plr,15,9999);
   SetPlayerWeapon(plr,17,9999);
   SetPlayerWeapon(plr,29,9999);
   SetPlayerPos(plr,pInfoLMS[plr][pX],pInfoLMS[plr][pY],pInfoLMS[plr][pZ],0,0);
   pInfoLMS[plr][JoinLMS] = 0;
SetTimer("QuitBugLMS",1000,0);
if (pInfoLMS[plr][LastVehicle] >= 1) {PutDirectlyInVehicle(plr,pInfoLMS[plr][LastVehicle]); pInfoLMS[plr][LastVehicle] = 0;}
else SetPlayerPos(plr,pInfoLMS[plr][pX],pInfoLMS[plr][pY],pInfoLMS[plr][pZ],0,0);
}





public CountLMS1()
{
   for(new i = 0; i <= MAX_PLAYERS; i++) {
   new plr = FindPlayerIDFromString(PlayerName(i));
   if(pInfoLMS[plr][JoinLMS] == 1){
  GameTextForPlayer(plr,"~b~-~y~ 3 ~b~-");
 }
  }
  return 1;
}

public CountLMS2()
{
   for(new i = 0; i <= MAX_PLAYERS; i++) {
   new plr = FindPlayerIDFromString(PlayerName(i));
   if(pInfoLMS[plr][JoinLMS] == 1){
  GameTextForPlayer(plr,"~b~-~x~ 2 ~b~-");
 }
  }
  return 1;
}

public CountLMS3()
{
   for(new i = 0; i <= MAX_PLAYERS; i++) {
   new plr = FindPlayerIDFromString(PlayerName(i));
   if(pInfoLMS[plr][JoinLMS] == 1){
  GameTextForPlayer(plr,"~b~-~h~ 1 ~b~-");
 }
  }
  return 1;
}

public CountLMS4()
{
   LMS1 = SetTimer("StarGameLMS",1000,1);
   for(new i = 0; i <= MAX_PLAYERS; i++) {
   
   new plr = FindPlayerIDFromString(PlayerName(i));
   if(pInfoLMS[i][JoinLMS] == 1){
         GameTextForPlayer(plr,"~b~- ~o~Go! Go! Go! ~b~-");
         SetPlayerWeapon(plr,21,9999);
         SetPlayerWeapon(plr,23,9999);
         SetPlayerWeapon(plr,32,9999);
         SetPlayerHealth(plr,100.0);
         TogglePlayerControllable(plr,1);
         }
}
return 1;
}




public GetLMSCount()
{
return gLMS[CountLMS];
}

public IncLMSCount(amount)
{
gLMS[CountLMS] = gLMS[CountLMS] + amount;
}

public DecLMSCount(amount)
{
gLMS[CountLMS] = gLMS[CountLMS] - amount;
}





stock NeedPlayerInArea(playerid,Float:MinX,Float:MaxX,Float:MinY,Float:MaxY)
{
      new Float:x,Float:y,Float:z;
      GetPlayerPos(playerid, x, y, z);
      if(x >= MinX && x <= MaxX && y >= MinY && y <= MaxY) return 1;
      else return 0;
      return 1;
}


And define this function, if not existe:

stock PlayerName(playerid)
{
     new name[24];
     GetPlayerName(playerid,name,24);
     return name;
}


    - OPTION 2 -
If they fail to put the codes right into your script, you can choose to lower my filterscript and add it to your server.

This filterscript filterscripts put it in the folder (if any) and if there add it, then you put in your server.cfg that is where your server, and inside it, add a line (if there) and named filterscripts below this the filter name "LMS".

   DOWNLOAD:Filterscript LMS to Mediafire  &&  Filterscript LMS to Megaupload

And that's all, for any questions or suggestions, let me know and we will gladly assist you.

Credits: YO ( Madara ).
MSN: [email protected]

Greetings. :D
#5
ShowRoom (pawn) / Speedometer by Madara
March 18, 2011, 05:05:14 AM
Hi all, here again up more code and utilities for use by their server, well this time I teach how to make the speedometer for vehicles (obio), well, begin.

To begin with we will create a numbering system, this type of system stores numbers, text or decimal numbers on a player, as this will use it to the speedometer and places it on top of our GM or where there are more of these. And is created if:

enum playerToSpeedo
{
   Speedo,
   SpeedoAct,
   Float:LastX,
   Float:LastY,
   Float:LastZ,
}


After that, you must create a new word which will be used this system along with the player that is building up the same, this will put it where it is located the other "new", but example "new gPlayers[MAX_PLAYERS][MAX_PLAYERS_NAME+1];. And it would be something if:

new Speedometer[MAX_PLAYERS][playerToSpeedo];

Now, we move into the "public OnPlayerDisconnect (playerid, reason)" and add this line to serve so that when a player leaves the server (for any reason), if he was in a car, you remove the ticket value "true", it does show you the speedometer of your vehicle. and is created is:

public OnPlayerDisconnect(playerid, reason)
{    
   if(Speedometer[playerid][Speedo] == 1) Speedometer[playerid][Speedo] = 0;
   return 1;
}


After that, we move into the "public OnPlayerEnterVehicle (playerid, vehicles, ispassenger)", there arem also the same as what we made in public before, but this time with the ticket if your speedometer is on, this is so when the player enters the vehicle, the speedometer will check if he has his kph on, and if you send your speedometer. And it would be more or less if:

public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
   if(Speedometer[playerid][Speedo] == 0 && Speedometer[playerid][SpeedoAct] == 0) Speedometer[playerid][Speedo] = 1;
   return 1;
}


Likewise, we will do the same in the "public OnPlayerExitVehicle (playerid, vehicle), but this time it will remove the ticket of" true "to get your speedometer while not in the vehicle, and if you avoid mistakes. We will make it if:

public OnPlayerExitVehicle(playerid, vehicleid)
{
   if (Speedometer[playerid][Speedo] == 1) {Speedometer[playerid][Speedo] = 0; GameTextForPlayerBottom(playerid,"\x10");}
   return 1;
}


Now create the command to ask if they want their kph is displayed or not. And places it in either "public", where you put the commands, but for any confusion, we will put an example in the "public OnPlayerText (playerid, cmdtext [])":

public OnPlayerText(playerid, cmdtext[])
{
if (strcmp(cmd, "!kph", true) == 0) {
       new MSN[256]; tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) {format(MSN, 256,"[Syntax] - The correct use: %s <on/off>",cmdtext); SendClientMessage(playerid, 0x04A36BFF, MSN);}
else {
     if (strcmp(tmp, "on", true) == 0) {
 if (Speedometer[playerid][SpeedoAct] == 0) SendClientMessage(playerid, 0x04A36BFF,"[Error] - You have are already KpH turned ON.");
 else {
Speedometer[playerid][SpeedoAct] = 0;
SendClientMessage(playerid, 0x04A36BFF,"KpH turned ON.");
if(IsPlayerInAnyVehicle(playerid)) Speedometer[playerid][Speedo] = 1;
}
      }
              else if (strcmp(tmp, "off", true) == 0) {
  if (Speedometer[playerid][SpeedoAct] == 1) SendClientMessage(playerid, 0x04A36BFF,"[Error] - You have are already KpH turned OFF.");
  else {
Speedometer[playerid][SpeedoAct] = 1;
SendClientMessage(playerid, 0x04A36BFF,"KpH turned OFF.");
if(IsPlayerInAnyVehicle(playerid)) {Speedometer[playerid][Speedo] = 0; GameTextForPlayerBottom(playerid,"\x10");}
}
          }
 else SendClientMessage(playerid, 0x04A36BFF,"[Syntax] - The correct use: !kph <on/off>");
    }
    return 1;
      }

      return 0;
}


PD:If you do not have tmp defined, define it as if they have the function strtok

Now, place a timer that causes the "speedo" remain active on the server, we first started putting it in the "public OnGameModeInit ()":

public OnGameModeInit()
{
SetTimer("SpeedoVehicle",500,1);
       return 1;
}


And finally we will create this function we put in the timer, this function is the process done to take out the distance traveled by a vehicle, more than anything, this function takes the positions you have with the latter having, by the way to qui system will use texts that are "LastX, LastY, LastZ" as if by the same coordinate multipilcarlas divided into 2, and added the three after having taken each of the coordinates, and will use its value to mutiplicarlos then the speed way to display the numbers:

public SpeedoVehicle()
{
new Float:x, Float:y, Float:z, Float:distance, MSN[256];
   for(new i = 0; i <= MAX_PLAYERS; i++) {
   new plrv = FindPlayerIDFromString(gPlayers[i]);

   if (Speedometer[i][Speedo] == 1 && IsPlayerConnected(i) && IsPlayerInAnyVehicle(i)) {
   GetPlayerPos(plrv, x, y, z);
   distance = floatsqroot(floatpower(floatabs(floatsub(x,Speedometer[plrv][LastX])),2)+floatpower(floatabs(floatsub(y,Speedometer[plrv][LastY])),2)+floatpower(floatabs(floatsub(z,Speedometer[plrv][LastZ])),2));
            Speedometer[plrv][LastX] = x;
            Speedometer[plrv][LastY] = y;
        Speedometer[plrv][LastZ] = z;
       format(MSN, sizeof(MSN), "~x~KpH: ~h~ %d",floatround(floatmul(distance,3.2)));
       GameTextForPlayerBottom(plrv,MSN);
   }
  }
  return 1;
}


Well, with this finish a speedometer for our server, I hope you like it and one more thing, if it has "FindPlayerIDFromString (agregenla [])", tag on your server, also the " strtok (cmdtext, idx) "but if you already have, not add it.

Credits: YO ( Madara ) + SAMP.

Greetings. :D
#6
Many are wondering how to make an anti-spam on your server, as a way of doing here with this little code, and i will show two different ways.

- FIRST FORM -

First of all, need to define a couple of words that will serve to check how many messages are sent through time, this must go down where are the lines #include.
And it is if:
#define LIMIT_REP_SPAM     3
#define MSNxSEC    1750


Now, will make new words, which define a word representing the player, whether as the gPlayers[playerid], but this time would be two, one for each message, and another post player, this must go down where all the define. And it would to if:

new MSNCount[MAX_PLAYERS];
new MSNPlayer[MAX_PLAYERS];


After that, they will put this little code that has sent the message by time, and located below the public OnPlayerText (playerid, cmdtext[]). And I would put sii:

public OnPlayerText(playerid, cmdtext[])
{

   new MSN[256],spammer = (GetTickCount()-MSNCount[playerid])/MSNxSEC;
   MSNPlayer[playerid]+=spammer-1;
   if(MSNPlayer[playerid]>LIMIT_REP_SPAM)MSNPlayer[playerid]=LIMIT_REP_SPAM-1;
   if(MSNPlayer[playerid]<0)MSNPlayer[playerid]=-1;
       MSNCount[playerid]=GetTickCount();
       if(MSNPlayer[playerid]<0) {
       format(MSN,256,">> Auto-Kick %s, ID %d, Reason: [ No Spam/Flooding ].", PlayerName(playerid), playerid);
       SendClientMessageToAll(0x377DFFFF,MSN);
       Kick(playerid);
return 1;
   }
   
 return 0;
}


This will get to kick players who send mass messages, and finally create the function that refers to the player's name:

stock PlayerName(playerid)
{
     new name[24];
     GetPlayerName(playerid,name,24);
     return name;
}


Now this kind of anti-spam is for those who send messages fast but with lyrics changed, but now, so those who send the same message, but slower than the time it gets a bit annoying, because here they teach the second form:

- SECOND FORM -

To begin with we will create a system of enumeration, this type of system stores numbers, text or decimal numbers on a player and places him at the top of our GM or where there are more of these. And is created if:

enum playerToSpamm
{
   CountText,
   LastText[256],
}


After that, you must create a new word which will be used this system along with the player that is building up the same, this will put it where it is located the other new, but example "new gPlayers[MAX_PLAYERS][MAX_PLAYERS_NAME+1];. And it would be something if:

new Spamming[MAX_PLAYERS][playerToSpamm];

Now, we move into the public OnPlayerText (playerid, cmdtext []);, and paste this line function of spamm:

public OnPlayerText(playerid, cmdtext[])
{
   PlayerSpamming(playerid,cmd,cmdtext);
   return 0;
}


And define that function down you GM, look:

public PlayerSpamming(playerid,cmd[],cmdtext[])
{
   if (strcmp(cmd, cmd, true) == 0) {
      if (strcmp(cmdtext, Spamming[playerid][LastText], true) == 0 && Spamming[playerid][CountText] >= 3) {format(MSN,256,">> Auto-Kick %s, ID %d, Reason: [ SPAMMING ].", PlayerName(playerid), playerid); SendClientMessageToAll(0x377DFFFF,MSN); Kick(playerid);}
      else {
   format(MSN,256,"%s", cmdtext);
           if (strcmp(cmd, Spamming[playerid][LastText], true) == 0) {Spamming[playerid][LastText] = MSN; Spamming[playerid][CountText] = Spamming[playerid][CountText] + 1;}
           else {Spamming[playerid][LastText] = MSN; Spamming[playerid][CountText] = 0;}
       }
}
return 1;
}


And with that we will have a kick by the same player to send messages over time.

By the way, I passed, in the "public OnPlayerDisconnect (playerid, reason), put it in an empty line:
public OnPlayerDisconnect(playerid, reason)
{
Spamming[playerid][CountText] = 0; // this in an empty line
return 1;
}


Well I hope you like it and comment if you have doubts, these codgis the job I did and I have different servers (including the one that got on this forum) and serves 100%, if they can not put it in your GM, and contacts to help me to put it.

     - OPTION 2 -
If they fail to put the codes right into your script, you can choose to lower my filterscript and add it to your server.

This filterscripts put it in the folder filterscript (if any) and if there add it, then you put in your server.cfg that is where your server, and inside it, add a line (if there) and named filterscripts below this the filter name "LMS".

    DOWNLOAD:Filterscript Anti-Spam to Mediafire  &&  Filterscript Anti-Spam to Megaupload

And that's all, for any questions or suggestions, let me know and we will gladly assist you.

Credits: YO ( Madara ).

Greetings  ;)

PD: Sorry for my bad English :-\
#7
Hi all, i come today to teach (for those who do not know) how to create the command "spawnallv" where all vehicles spawn in the game.

First of all, download this. ini which brings necessary information for that command.

  Folder to use in scriptfiles.

Put the folder in the folder scriptfiles vehicles (if the folder existing vehicles, just hanging separation.ini) and go to GM to put this command.

This command anger in the public OnPlayerCommandText8playerid, cmdtext)
public OnPlayerCommandText(playerid, cmdtext)
{
/*Below where the public begins OnPlayerCommandText (playerid, cmdtext)
define this:*/
      new Float:x, Float:y, Float:z; // If not exist, put that.
      new MSN[256]; // If not exist, put that.

      else if (strcmp(cmd, "spawnallv", true) == 0) {
// Here you put what you want, is to lock the command to members or need to spawn.
else {
 format(MSN,256, "Admin %s spawn all vehicles, Activated!", PlayerName(playerid));
                         SendClientMessageToAll(BLUE,MSN);
                         for(new v = 1; v <= NUMBERS; v++) {// <- depending on the vehicle you have on your server, put the number in that part.
                         new separation = dini_Int("/Vehicles/Separation.ini", IntToStr(v));
 GetPlayerPos(playerid, x, y, z);
 SetVehiclePos(v, x+10.0000, y+10.0000, z +separation, 0);
 }
   }
   return 1;
}

else if (strcmp(cmd, "delspawnallv", true) == 0) {
// Here you put what you want, is to lock the command to members or need to spawn.
else {
 format(MSN,256, "Admin %s delate and respawned all vehicles!", PlayerName(playerid));
                         SendClientMessageToAll(BLUE,MSN);  
                         for(new v = 1; v <= NUMBERS; v++) {// <- depending on the vehicle you have on your server, put the number in that part.
 SetVehicleToRespawn(v);
 }
   }
   return 1;
}

  return 0;
}


Define this function, if not exist:

stock PlayerName(playerid)
{
      new name[24];
      GetPlayerName(playerid,name,24);
      return name;
}


And ready, to test your command on the server.

I hope you liked it, then I'll post more stuff. If there is any doubt or question, make me know. If they do not fit or gives error, please tell me, I've already tried this command on my server, and I have put another, and if it works.

Credits: YO ( Madara ).

Greetings. :D
#8
Hi all, well today I come bringing a server free of charge, to which his name as shown in the title is WarChiefs v1.0 created by me ... although the gm will only have the ".AMX", later i will put ".PWN" to be edited.

-Server Warchiefs v1.0 -

   Author Name: Madara
   Created: 10th March 2011
   Uploaded: 14th March 2011 ( Warchiefs v1.0 ) with .PWN uploaded.
   Email: [email protected]
   Country: Mexico
   Credits: Yo ( Madara )
   Credits to Plugins: DracoBlue (plugins:include; dini, dutils, dudb, etc...)

   Download: Warchiefs v1.0 to Mediafire & Warchiefs v1.0 to Megaupload (Fixed)




Well, now i will mention the existing commands on the server:

/c register
/c login
/c cash
/c stats
/c deposit
/c withdraw
/c givecash
/c newpassword
/c level
/c data
/c infp

/c admins
/c ping
/c wep
/c goto
/c nogoto
/c hide
/c changeskin
/c hp
/c heal
/c skin
/c info
/c scripts
/c spree
/c myspree
/c rules
/c disarm
/c addquote
/c quote
/c cd
/c drunk
/c undrunk
/c wstats
/c randspawn
/c hunt
/c hunted
/c bstats
/c lms
/c playerslms
/c time
/c credits

/c buycar
/c sellcar
/c sharecar
/c desharecar
/c mycars
/c mysharecars
/c getcar
/c repair
/c renamecar
/c lockcar
/c gotov
/c eject
/c kph

/c buyprop
/c sellprop
/c shareprop
/c deshareprop
/c myprops
/c myshareprops
/c renameprop
/c propspawn
/c home


Admin Commands:

Moderator:
/c ann
/c pmann
/c get
/c setdrunk
/c setwep
/c setskin


Admin:
/c ban
/c kick
/c wepall
/c sethide
/c setloc
/c gotolocall
/c getall
/c healall
/c setspikes
/c ann
/c pmann
/c get
/c setdrunk
/c setwep
/c setspeed
/c setgrav
/c setwlevel
/c drunkall
/c quitarmall
/c undrunkall
/c get
/c setdrunk
/c setwep


Management:
/c setmon
/c setlevel
/c flycars
/c fastswitch
/c jumpswitch
/c setdriveby
/c shotinair
/c sethp
/c setarm
/c stuntbike
/c sethpv
/c putplayer
/c setkills
/c setdeaths
/c setpassword
/c kickall
/c freezeall
/c unfreezeall
/c killall
/c armall
/c unban
/c setcar
/c spawnallv
/c delspawnallv


In the folder "Configserver" located in "scriptfiles" there you can change the server name when you enter and set the rules of the server


And those are all the commands, well, I hope you like this server that I brought and contribution to all of you enjoy the server.

Any questions or suggestions you can tell me, also precent report errors on the server and immediately will help you.

IMPORTANT: The alteration of the script and create future errors will have no technical support, and removing the credits would cause a very severe decision of the operator, for example: no more versions or get much less help and technical support.

#9
ShowRoom (pawn) / System Banneds by Madara
March 11, 2011, 06:14:02 AM
First download this link:http://www.mediafire.com/?jnr27599hribuio, brings in a folder that says "Banneds" you put that folder in the folder "scriptfiles" (if you do not, create it). and paste these 4 functions in your "GameMode":

public InfoPlayerBanned(playerid)
{
new IP[256],MSN[256],BAN;
GetPlayerIp(playerid,IP,256);
BAN = dini_Int("/Banneds/Banlist.ini",IP);//find IP in the list.
if(BAN == 1){// if the IP in the list is 1, kick player (1 = true, 0 = false)
           format(MSN,256,">> Server Auto-Kick: %s - Reason: [IP Banned]",PlayerName(playerid));
           SendClientMessageToAll(0x377DFFFF,MSN);
           Kick(playerid);//kick player :P
                   }
}

public PlayerBanIP(playerid,admin,reason[])
{
       new IP[256],MSN[256],inf[256];
       GetPlayerIp(playerid,IP,256);
       format(inf,256,"1 %s %s %s",PlayerName(playerid),PlayerName(admin),reason);//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
       format(MSN,256,">> Admin %s Banned: %s, ID: %d, Reason:%s",gPlayers[admin],gPlayers[playerid],playerid,reason);
       SendClientMessageToAll(0x377DFFFF,MSN);
       Kick(playerid);//kick player xP
}

public PlayerUnBanIP(player[],admin,reason[])
{
new MSN[256],IP[256],param[2][128];
IP = dini_Get("/Banneds/PlayerBanlist.ini",player);
       split(dini_Get("/Banneds/Banlist.ini",IP), param, ' ');
       format(MSN,256,">> Admin %s Un-Banned: %s, Reason:%s",PlayerName(admin),param[1],reason);
       SendClientMessageToAll(0x377DFFFF,MSN);
       dini_Unset("/Banneds/Banlist.ini",IP);//remove IP banned the list
       dini_Unset("/Banneds/PlayerBanlist.ini",player);//remove the name list
}

public IsPlayerBanned(player[])
{
new ispb[256];
ispb = dini_Get("/Banneds/PlayerBanlist.ini",player);//find IP to check list banneds
return (strcmp(ispb, "0", true) == 0) ? false : true;//checks the existence of the player or not
}


Now, in function "public OnPlayerConnect (playerid)," hit this InfoPlayerBanned (playerid), which would be more or less if:

public OnPlayerConnect(playerid)
{
InfoPlayerBanned(playerid);
return 1;
}


Now paste these 2 commands in function "public OnPlayerCommandText (playerid, cmdtext [])":

   else if (strcmp(cmd, "ban", true) == 0) {
new plr,reason[256];
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp), reason = strtok(cmdtext, idx);
if (!strlen(reason)) SendClientMessage(playerid,0x04A36BFF,"** pm >> [Syntax] - The correct use: /c ban <player> <reason>");
  else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,0x04A36BFF,"** pm >> [Error] - Unknown player.");
else {
                PlayerBanIP(plr,playerid,cmdtext[strval(reason)+strlen(tmp)+4]);
}
return 1;
    }

   else if (strcmp(cmd, "unban", true) == 0) {
new reason[256];
tmp = strtok(cmdtext, idx), reason = strtok(cmdtext, idx);
if (!strlen(reason)) SendClientMessage(playerid,0x04A36BFF,"** pm >> [Syntax] - The correct use: /c unban <player> <reason>");
  else if (!IsPlayerBanned(tmp)) SendClientMessage(playerid,0x04A36BFF,"** pm >> [Error] - This player is't banned, insert full name.");
else {
               PlayerUnBanIP(tmp,playerid,cmdtext[strval(reason)+strlen(tmp)+6]);
}
return 1;
    }


And define this function, if not exist:

stock PlayerName(playerid)
{
      new name[24];
      GetPlayerName(playerid,name,24);
      return name;
}


All these are functions that are used to see a player banned and check if it exists in the list.

Credits: YO ( Madara ).

Greetings ;)
#10
Hello all  ;D, well, I am a bit new to this, but today I come to let a small filterscript that makes adding quotes to your server and can view them later, is anumeran with ID, but hey, there is less left the download, true if you do not come to work, advise, whether to check, but check it before uploading it  ::):

Option 1: http://zerovcmp.windlord.net/downloads/ModeQuotesChetosByMadaraIvan.rar  ;)
Option 2:  Function Addquote to Megaupload   ;)

1 .- Add the archvivo "Quotes.PWN" and "Quotes.AMX" to folder "filterscripts" does not exist, create it.
2 .- Add the folders "AddQuotes" to folder "scriptfiles" does not exist, create it
3 .- Finally, you go to file "server.cfg" and open it on the line "filterscripts" make a space and type "Quotes"
   without quotes. If there is no line "filterscripts", add it yourself.
4 .- Finishing all, turn on your server and you get, use it! Quote ID to view messages, and! Addquote to add messages.

   PD: All this should go into your folder where you have your server Pawn.

NOTE: There was a slight bug in the FS and I've fixed it, the verdict is: not showing or waiting for the name of the player who had added the quote. Now it is ready, and if they see another bug, not hesitate to tell me.

Credits: YO ( Madara ).

Greetings. :D
#11
mIRC/pawn Scripting / Pawn want to know
April 06, 2010, 07:36:41 AM
Hello :), well today I'm looking for help, Pawn, let me know if there is a pawn in the "Last Man Standing" (! Lms), how to make play time is active, because when I walk in, the clock is suspended or does not mark the time as a server, it stays frozen in a single hour, also like to know how to do the game to add properties or homes for sale. That would be all for now in my doubts, I hope your help ::) ::).

#12
Well, I was wondering how to do the script so that in one person and Madada server to a location, as the command "! Gotoloc" try it with the tutorial that is on the pawn, but makes no impact on the server, which is should do, if someone can explain me?, also let me know if you can do the command "! saveloc" in the Pawn.

Another thing since I'm talking about the Pawn tutorial, scripts 1.15 Gups Pawn, often fail in the command car, the "! Getca" failure sends him a bit if not more than 2 cars, but sometimes that after 2 and does not pull when you put that command.

#13
Support / i need help with my PC
March 29, 2010, 06:30:42 AM
Bien, hay un problema en mi compu que no he podido resolver desde hace ya un poco de tiempo, pero bien les explic de que trata, lo que pasa es que mi server no sale en la pestaña internet, ni cuando doy el ip de mi server, no se que pasa con mi maldita pc, necesito de alguien sepa abiri puerto, por que ya he abierto el puerto de mi server, tanto como en el firewall y en el modem, y nada funciona, a por cierto, uso el server que esta en la pagina vicecitymultiplayer al que se le pone los scripts de pawno, pero bien habia escuchado que tamvien a ese se le debia agregar una termina abajo como esta:

echo Executing Server Config...
friendlyfire 1
lanmode 0
maxplayers 25
port 5192
hostname [R2]Server
gamemode0 mode 1
rcon_password none
announce 1

le puse eso por que asegun a si podria aparecer en la pestaña internet, pero no funciona!!!

Mi compañia de internet es Telmex
y uso sistema Windows Vista Premium

Si hay alguien que sepa en como ayudarme, aqui los espero por que en verdad la necesito.

#14
General Discussion / Who can help me?
March 25, 2010, 07:02:41 PM
Well first of all I greet and thank to those who see my theme, but well, now to the point, I need someone to teach me to create scripts (if not too much trouble), or at least a tutorial on how to create scripts Is that I want to create a server, but not create scripts, much less, my server does not leave the Internet tab of VC-MP, well, hopefully help me.

By the way, i'm Madara,mi nick del VC-MP es Madara, y no otros nicks que he visto, como: madera, madaranobHSKpro, MADARA, Madare, nooo!!!!

I am single and my msn is [email protected] ;D