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.


Topics - NeskWriter

Pages: [1] 2 3
1
Snippet Showroom / GetPlayerNameFromID
« on: September 13, 2014, 01:48:01 pm »
Hey scripters, In short, this function returns player name from the ID, what might be useful.
Code: [Select]
stock GetPlayerNameFromID(playerid)
{
new str[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(str, sizeof(str), "%s", pname);
return str;
}

2
General Discussion / A $100 question
« on: April 10, 2014, 04:42:05 pm »
That's a question to everyone who is watching this topic. If you had $100, would you ever buy a perfectly working, popular, original gamemode (not a gups-based trash) with features never released before? Justify your decision. Thanks for attention.

3
mIRC/pawn Scripting / Should I?
« on: January 11, 2014, 09:35:09 pm »
Hi dudes, decided to back to coding for some time, so, this event forced me to think about scripting my own trashful server. I don't want it to be based on GUPS or something else and also, I don't want to use someone's includes like dini/mysql etc. In short, I wanna code my own include. And if some of advanced coders helps me doing this, I would be grateful :D.

4
General Discussion / The absolute record?
« on: November 11, 2013, 06:43:01 pm »
The maximum number of hosted (launched) servers of VCMP I ever saw is 87 lol (today). So hbu?

5
mIRC/pawn Scripting / Wanna write include
« on: October 29, 2013, 05:00:55 pm »
Hye dudes. I wanna try writing my own include but I dunno how to deal with shit like "#endif #if_defined #define #etc". I want veteran scripters to explain

6
mIRC/pawn Scripting / "GetVehiclePos" function works incorrectly
« on: October 18, 2013, 11:19:45 pm »
The function that should get X, Y, Z coordinates of the vehicle does not work, as many of you may noticed. Instead of this, GetVehiclePos gets X, Y, Z coordinates of vehicle spawnpoint. It's just a bug report to VCMP developers. And, yeah, if you use this function to write a code of locking/unlocking car, you should declare new variables in which you will store player coordinates, given in OnPlayerLeaveVehicle.

7
General Discussion / zero gravity (wtf)
« on: October 18, 2013, 09:54:30 pm »
Hai. I dunno if this bug report (or not, I dunno) was posted here earlier, but I found it like 3-5 minutes b4. It's done by pressing the "F" key many times while the vehicle falls. Here are screenshots:



8
Snippet Showroom / Long shot code
« on: October 13, 2013, 04:01:16 pm »
As you may already know, this code deals with a long shot. Yes, if you kill a player, a stock function will compare the distance between you and your victim/you and the guy who shot you. if the distance is longer than 50 meters, you/your killer will be congratulated.

P.S. Seby has told me that it was not a new idea, so excuse me if the similar code already exists!

[pawn]
public OnPlayerDeath(playerid, killerid, reason, bodypart)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        if(GetDistanceBetween(playerid, killerid) >= 50) //Replace "50" with your own integer, if you want. "50" is the default distance of long shot between victim and killer.
        {
            new longshotmsg[128];
            format(longshotmsg, sizeof(longshotmsg), "%s killed %s by a long shot.", RetPlayerName(killerid), RetPlayerName(playerid));
            SendClientMessageToAll(COLOR_GREEN, longshotmsg);
            SetPlayerMoney(killerid, GetPlayerMoney(playerid) + 1000);
            SendClientMessage(killerid, COLOR_GREEN, "You've been given $1000 as a bonus of long shot");
        }
    }
    return 0;
}
[/pawn]
Here are stock functions I used:
[pawn]
//A stock function to get distance between two players (very similar to that one from GUPS)
stock GetDistanceBetween(playerid, playerid2)
{
new Float:px, Float:py, Float:pz, Float:px2, Float:py2, Float:pz2, Float:distance;
GetPlayerPos(playerid, px, py, pz);
GetPlayerPos(playerid2, px2, py2, pz2);
distance = floatsqroot(floatpower((px2 - px), 2) + floatpower((py2 - py), 2) + floatpower((pz2 - pz), 2));
return floatround(distance);
}
//This function returns player name
stock RetPlayerName(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    return pname;
}
//This is definition of HEX-code of green color
#define COLOR_GREEN 0x00FF00AA
[/pawn]

9
Videos and Screenshots / Jim Carrey
« on: October 02, 2013, 10:28:35 pm »
Well, I had no idea what might look cool for vc, but then I watched "Mr. Popper's Penguins". this is trash, not anything else than, but, somehow, I would feel bad if I don't share this with u guys

10
General Discussion / Lost connection to the server...
« on: August 06, 2013, 11:26:42 am »
Okay so, every server I am trying to connect getting disconnected in 15 secs. if I spawn, the message "Lost connection to the server" will be shown in a few seconds. I have no idea why this is happening to me but I started feeling that VC-MP is imperfection.
Also, if I get banned from the server, this server will not be shown in the serverlist next times. Help mmme


Sry for kinda big image, but I am too lazy to cut the chatbox only

11
Snippet Showroom / Use !afk and go pissing
« on: March 18, 2013, 07:21:29 pm »
Hello! This is simple script which guarantees you protection of your player while you're pissing (OOC) ;).
All you need is just to paste this code:

In the beginning:
[pawn]
new playerisafk[MAX_PLAYERS];
new Float:px, Float:py, Float:pz;
[/pawn]

In public OnPlayerText(playerid, text[])
[pawn]

    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
   if(strfind(text, "!afk", true, 0) != -1)
   {
      if(!playerisafk[playerid])
      {
           GetPlayerPos(playerid, px, py, pz);
          new string[256];
          format(string, sizeof(string), "%s is now AFK (Away from keyboard).", pname);
          SendClientMessageToAll(0xFF875AA, string);
          SetPlayerPos(playerid, 474.23223, -1717.48022, 62.5, 135, 0); // change date coords on your own (I've made it lighthouse's rooftop for a standart ;).
          TogglePlayerControllable(playerid, 0);
          playerisafk[playerid]=1;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are still in the AFK mode.");
      }
      return 1;
   }
   else if(strfind(text, "!back", true, 0) != -1)
   {
      if(!playerisafk[playerid])
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are not in the AFK mode.");
      }
      else
      {
          new string2[256];
          format(string2, sizeof(string2), "%s is now Back", pname);
          SendClientMessageToAll(0xFF875AA, string2);
          SetPlayerPos(playerid, px, py, pz, 0, 0);
          TogglePlayerControllable(playerid, 1);
          playerisafk[playerid]=0;
      }
      return 1;
   }
[/pawn]

I tried to make it mo' advanced, so:
1st. You can't use !afk if you're already afk - it is for anti-abusing, 4 example, flooding.
2nd. You can't use !back if you aren't afk - specially for old people with sclerosis.
3rd. !back will return you to the place whr you used !afk.

Dank je voor uw aandacht  :D.

12
mIRC/pawn Scripting / Nesk became a zombie. Take this.
« on: March 11, 2013, 10:21:49 pm »
Hello. It's hard to write, because I haven't been here for a while. After I was infected I became a zombie, but I don't drink human's blood, I like orange juice mo'. So, I'll visit you once a month or more, cuz people say that's better to learn programming languages when you are young. I'd like to share my healing system. Yeah lol, but money amount to pay depends from hp u need, that's for nerdos who's gonna break their display for paying $100000 to take 1hp. I hope Aled won't call this script a bull shit, and:
[pawn]stock SellPlayerHealth(playerid)
{
   new Float:phealth, Float:product1, Float:product2;
   new pmoney = GetPlayerMoney(playerid);
   new money2pay[256];
   GetPlayerHealth(playerid, phealth);
   if(phealth <= 99)
   {
      product1 = floatsub(100, phealth);
      product2 = floatmul(product1, 5);//My price for 1hp is $5, change "5" on your integer if you want
      format(money2pay, sizeof(money2pay), "%0.2f", product2);
      new money2payfinal = strval(money2pay);
      if(money2payfinal <= pmoney)
      {
          SetPlayerHealth(playerid, 100);
          SetPlayerMoney(playerid, pmoney - money2payfinal);
         new string2[256];
         format(string2, sizeof(string2), "You have been healed for $%d", money2payfinal);
         SendClientMessage(playerid, 0xFFFFFFAA, string2);
      }
      else
      {
          new string3[256];
          format(string3, sizeof(string3), "You don't have enough money (you need $%d)", money2payfinal);
          SendClientMessage(playerid, 0xFF0000AA, string3);
      }
   }
   else
   {
       SendClientMessage(playerid, 0xFF0000AA, "You don't need to heal yourself");
   }
}[/pawn]

13
mIRC/pawn Scripting / Good bye, dear friends.
« on: March 01, 2013, 10:52:29 pm »
Oh guys, this is the last letter I'll write to u. Since I registered here I made a good friends (especially Saint, mrockxking). I decided to shut down my pawn scripter career because of it's useless results. I didn't take any respect here, I suck anyway (not dick). I'd like to join the university in the capital after 2 years of studying in school (term that left left) and learn programming then, I wanna make it be my life work. I hope all u will find yourself in this scripting category and in your life. Dank u to Saint, u helped me everytimes, I hope ur multiplayer will become the greatest thing for VC. mrockxking, continue scripting, u made more successes than me. Aledark, learn english, continue working, I hope u will learn more offencive terms than "stupid" and U'll be a good scripter with ethics. So, I gonna remove any pawn docs and server just now, I hope u will understand me. Just I don't wanna be a dick.
Goodbye  :(

14
Snippet Showroom / Making a chainsaw!
« on: February 05, 2013, 09:04:52 pm »
Hello! Today after school I've made new chainsaw completing script. I mean that you can now make chainsaw from materials you will find.
Okay so, first to all I'd like to explain here the "recipe". YEAH

Chainsaw:
1. Cutting equipment;
2. Scooter engine;
3. Frame
4. Fueltank;
5. Gears package.

Use "!demountengine" to demount the engine when you are driving Faggio. When u will find all these "ingredients" u can make a chainsaw using "!makechainsaw". BUT this is not the end because your chainsaw won't work without fuel like you when you hungry. So then u go to the nearest gas station and fill it for $10 (I made $10 cuz I think it's not too much as for VCMP player =P)

Okay, here is code:

put in the beginning:
[pawn]
new cuttingequipment[MAX_PLAYERS];
new gear[MAX_PLAYERS];
new framewithhandles[MAX_PLAYERS];
new fueltank[MAX_PLAYERS];
new engine[MAX_PLAYERS];
new madechainsaw[MAX_PLAYERS];
new filledtank[MAX_PLAYERS];
[/pawn]

put in public OnGameModeInit():
[pawn]
    AddStaticVehicle(192, 112.35513, -1150.53576, 31.30939, 0, 0, 0);//must be the first vehicle, I mean the first in the list
    AddStaticVehicle(192, 114.86677, -1150.51501, 31.30939, 0, 0, 0);//must be the second vehicle =P
    AddStaticPickup(1, 346, -1243.28869, 83.49330, 11.87996);
    AddStaticPickup(2, 346, -974.83831, -693.88696, 11.52398);
    AddStaticPickup(3, 346, -1064.71887, 344.63726, 11.26404);
    AddStaticPickup(4, 346, -1190.05808, -304.88229, 11.38048);
    AddStaticPickup(5, 578, 43.34131, -1055.93249, 10.46328);
[/pawn]

put in public OnPlayerText(playerid, text[]):
[pawn]
{
   if(strcmp(text, "!demountengine", true)==0)
   {
      if(IsPlayerInAnyVehicle(playerid))
      {
         new vehicleid = GetPlayerVehicleID(playerid);
         if(vehicleid==1 || vehicleid==2)
         {
            if(engine[playerid]==0)
            {
                 SendClientMessage(playerid, 0x00C80CAA, "The engine has been demoted!");
                 KillVehicleEngine(vehicleid);
                 engine[playerid]+=1;
            }
            else if(engine[playerid]==1)
            {
                SendClientMessage(playerid, 0xFF0000AA, "You already have an engine!");
                }
            return 0;
         }
         else
         {
             SendClientMessage(playerid, 0xFF0000AA, "You are not driving faggio!");
         }
         return 1;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are onfoot!");
      }
      return 1;
   }
   else if(strcmp(text, "!makechainsaw", true)==0)
   {
      if(engine[playerid]>=1 && cuttingequipment[playerid]>=1 && gear[playerid]>=1 && framewithhandles[playerid]>=1 && fueltank[playerid]>=1)
      {
          SendClientMessage(playerid, 0x00C80CAA, "You have made chainsaw from materials. Go to the gas station to fill it.");
          madechainsaw[playerid]=1;
          engine[playerid]-=1;
          cuttingequipment[playerid]-=1;
          gear[playerid]-=1;
          framewithhandles[playerid]-=1;
          fueltank[playerid]-=1;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You don't have enough materials!");
      }
      return 1;
   }
   return 1;
}
[/pawn]

put in public OnPickedUp(pickupid, playerid):
[pawn]
{
   if(pickupid==1)
   {
       cuttingequipment[playerid]+=1;
       GameTextForPlayer(playerid, "~o~Cutting equipment ~h~has been found!");
   }
   else if(pickupid==2)
   {
        gear[playerid]+=1;
       GameTextForPlayer(playerid, "~o~Gears package ~h~has been stolen!");
   }
   else if(pickupid==3)
   {
       framewithhandles[playerid]+=1;
       GameTextForPlayer(playerid, "~o~Frame ~h~has been found!");
   }
   else if(pickupid==4)
   {
       fueltank[playerid]+=1;
       GameTextForPlayer(playerid, "~o~Fuel tank ~h~has been found!");
   }
   else if(pickupid==5)
   {
      if(madechainsaw[playerid]==1)
      {
         new pmoney = GetPlayerMoney(playerid);
         if(pmoney>=10)
         {
                GameTextForPlayer(playerid, "~h~Your chainsaw fuel tank has been filled for ~t~$10");
                SetPlayerWeapon(playerid, 11, 1);
                filledtank[playerid]=1;
                madechainsaw[playerid]-=1;
         }
         else
         {
                SendClientMessage(playerid, 0xFF0000AA, "You need atleast ~t~$10 to fill your chainsaw fuel tank!");
            }
         return 1;
      }
      else
      {
          GameTextForPlayer(playerid, "~h~You need to equip ~o~chainsaw first!");
      }
      return 1;
   }
   return 1;
}
[/pawn]

I hope you will understand the making process, and I also hope u will be CAREFUL, not like this Guy:


HERE are screenshots with materials locations:












Comments pls!

15
General Discussion / Reputation points system suggestion
« on: January 27, 2013, 11:31:26 pm »
Hey guys (moderators), I'd like to request u to make Reputation system on the forum. It can make user respect or disrespect another one. Reputation points should be displayed in bottom of user's account. If u got free time, pls, read this. I have seen that on another forums

Pages: [1] 2 3