Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 583 online users. » 0 Member(s) | 581 Guest(s) Google, Yandex
|
|
|
Server requset |
Posted by: alimaroco - 04-14-2017, 12:07 PM - Forum: General Support
- Replies (1)
|
|
Full name:-Ali Maroco
E-mail address:-Jimiroso12@gmail.com
Gamemode type:-RP
Server version:-0.3.7
Why would you like to acquire a free server from EHN?Because I love SAMP so much and I want to own my own server
Any further comments/information? Thanks so much for hosting free server's
|
|
|
How to create a pickup that can be picked-up on-foot and in-vehicle |
Posted by: alimaroco - 04-13-2017, 11:10 PM - Forum: Tutorials
- Replies (1)
|
|
his allows pickups to be picked up on foot and in vehicle. This is not much of a tutorial.
Requirements
The Script
First we make a limit for pickups, since we're gonna use 2 pickups per 1 pickup in this tutorial, we're gonna cut the limit in half
Code:
Quote:#define MAX_PICKUPS_EX (MAX_PICKUPS / 2) // which is 2048, Limit has been cut in half
Secondly, create the enum data structure for the ID storing
g_P_ID repesents the real pickup model that can only be picked up on - foot, and g_P_Invisible_ID represents the invisible model that can only be picked up in vehicle
Code:
Quote:enum e_Pickups
{
g_P_ID,
g_P_Invisible_ID
};
Thirdly we create the variables for the iterator and to manipulate the enum
Code:
Quote:new gPickupData[MAX_PICKUPS_EX][e_Pickups],
Iterator:gPickups[MAX_PICKUPS_EX];
Fourthly we make the pickup creation function
This function creates the model and an invisible pickup (19300) SA-MP 0.3c+ (Is it?)
Code:
Quote:stock CreateStaticPickup(model, Float:x, Float:y, Float:z, virtualworld = 0)
{
new id = Iter_Free(gPickups);
gPickups[id][g_P_ID] = CreatePickup(model, 14, x, y, z, virtualworld);
gPickups[id][g_P_Invisible_ID] = CreatePickup(19300, 14, x, y, z, virtualworld);
return id;
}
Fifthly we create a way to SAFELY destroy the pickups
Code:
Quote:stock DestroyStaticPickup(id, &next)
{
if(Iter_Contains(gPickups, id)) return -1;
DestroyPickup(gPickups[id][g_P_ID]);
DestroyPickup(gPickups[id][g_P_Invisible_ID]);
Iter_SafeRemove(gPickups, id, next);
return next;
}
Lastly, we need someway to detect if either ONE of the pickups were entered, right? Don't worry we only need this ONCE, because your not gonna enter the pickup while your in both states, the callback only gets called in either state
Code:
Quote:public OnPlayerPickUpPickup(playerid, pickupid)
{
foreach(gPickups, p)
{
if(gPickups[p][g_P_ID] != pickupid && gPickups[p][g_P_Invisible_ID] != pickupid) continue;
// do shit here
new next; // I don't even think that this is needed, but for safety, let's leave it.
p = DestroyStaticPickup(p, next); // Let's SAFELY destroy the pickup without breaking the loop
break;
}
return 1;
}
The Full Code
Code:
Quote:#define MAX_PICKUPS_EX (MAX_PICKUPS / 2) // which is 2048, Limit has been cut in half
enum e_Pickups
{
g_P_ID,
g_P_Invisible_ID
};
new gPickupData[MAX_PICKUPS_EX][e_Pickups],
Iterator:gPickups[MAX_PICKUPS_EX];
stock CreateStaticPickup(model, Float:x, Float:y, Float:z, virtualworld = 0)
{
new id = Iter_Free(gPickups);
gPickups[id][g_P_ID] = CreatePickup(model, 14, x, y, z, virtualworld);
gPickups[id][g_P_Invisible_ID] = CreatePickup(19300, 14, x, y, z, virtualworld);
return id;
}
stock DestroyStaticPickup(id, &next)
{
if(Iter_Contains(gPickups, id)) return -1;
DestroyPickup(gPickups[id][g_P_ID]);
DestroyPickup(gPickups[id][g_P_Invisible_ID]);
Iter_SafeRemove(gPickups, id, next);
return next;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
foreach(gPickups, p)
{
if(gPickups[p][g_P_ID] != pickupid && gPickups[p][g_P_Invisible_ID] != pickupid) continue;
// do shit here
new next; // I don't even think that this is needed, but for safety, let's leave it.
p = DestroyStaticPickup(p, next); // Let's SAFELY destroy the pickup without breaking the loop
break;
}
return 1;
}
- Enjoy
Credits- Kalcor & The SA-MP Team (For SA-MP and the Invisible Object)
|
|
|
Dialog System |
Posted by: alimaroco - 04-13-2017, 09:16 PM - Forum: Tutorials
- Replies (2)
|
|
Hello guys,
today i'm going to show you how to detail anything you want in any dialog! That's very easy but yet some people do not know how to do so. So, i made this tutorial to show them some examples of it. So, without wasting times, we'll start our tutorial!
STEP 1 - USING FORMAT
So, about using formats, it's really very simple. I'll show you an example of it right now.
PHP Code:
Code: CMD:name(playerid,params[])
{
new string[128], /*This is to define the string and the size of it*/ pName[MAX_PLAYER_NAME]; // Name variable
GetPlayerName(playerid, pName, sizeof(pName)); // Getting the player name
format(string, sizeof(string), "Your name is %s with ID %i !", pName, playerid); // Formatting the message
SendClientMessage(playerid, -1, string); // Sending the message to the player
return 1;
}
You see, it's very simple. But now, instead of using SendClientMessage, we will change it to ShowPlayerDialog!
Format explained more easily here!
STEP 2 - SHOWPLAYERDIALOG
So, now we will change the same thing to showplayerdialog!
PHP Code:
Code: CMD:name(playerid,params[])
{
new string[128], /*This is to define the string and the size of it*/ pName[MAX_PLAYER_NAME]; // Name variable
GetPlayerName(playerid, pName, sizeof(pName)); // Getting the player name
format(string, sizeof(string), "Your Name: %s \n Your ID: %i", pName, playerid); // Formatting the message
ShowPlayerDialog(playerid, 21, DIALOG_STYLE_MSGBOX, "EXAMPLE" , string , "Ok", ""); // ShowPlayerDialog
return 1;
}
So now, we have formatted it to ShowPlayerDialog!
Additional Note: While formatting to message, use \n for the dialog to skip one line! And also instead of usig DIALOG_STYLE_MSGBOX you can use any type of dialog style, this doesn't require only DIALOG_STYLE_MSGBOX!
STEP 3 - STRCAT
So, we use strcat to make really long dialog without making them crashing, strcat has also other more purposes.
Here, strcat is more explained!
PHP Code:
Code: CMD:name(playerid,params[])
{
new Dialog[128], /*This is to define the string and the size of it*/ pName[MAX_PLAYER_NAME]; // Name variable
GetPlayerName(playerid, pName, sizeof(pName)); // Getting the player name
format(Dialog, sizeof(Dialog), "Your Name: %s ", pName); // Strcat
format(Dialog, sizeof(Dialog), "Your ID: %i ", playerid); // Strcat
// You can add more formats here
ShowPlayerDialog(playerid, 21, DIALOG_STYLE_MSGBOX, "EXAMPLE" , Dialog , "Ok", ""); // ShowPlayerDialog
return 1;
}
STEP 4 - DEFINE THEM
So, now we are going to define the IDs of the dialogs we are going to be using. Defining dialogs are important! If we do not define them, we can make another dialog and use an already defined id for a dialog. So, let's proceed in for more information.
PHP Code:
Code: enum
{
DIALOG_NAME
}
#define DIALOG_NAME 1
CMD:name(playerid,params[])
{
new string[128], /*This is to define the string and the size of it*/ pName[MAX_PLAYER_NAME]; // Name variable
GetPlayerName(playerid, pName, sizeof(pName)); // Getting the player name
format(string, sizeof(string), "Your Name: %s \n Your ID: %i", pName, playerid); // Formatting the message
ShowPlayerDialog(playerid, DIALOG_NAME, DIALOG_STYLE_MSGBOX, "EXAMPLE" , string , "Ok", ""); // ShowPlayerDialog and using defined dialog IDs
return 1;
}
END OF TUTORIAL
Credits
Karan007 - Created this tutorial
Jim - Created this tutorial
SA-MP Team - Created SA-MP
Y_Less - Sscanf
Zeex - ZCMD
PawnHunter - Strcat suggestion
MartinSwag - Defining suggestion
TheBetaFox - Strcat tutorial
|
|
|
How to create a Timer |
Posted by: alimaroco - 04-13-2017, 07:06 PM - Forum: Tutorials
- Replies (1)
|
|
Hello everyone, as we know. Is there people who do not know what is a timer and how to create it. In this tutorial i will teach how to:
We create the timer
Code:
Quote:public OnGameModeInit()
{
//==========================================================================
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Gamemode");
SetTimer("RandomMessage", 5000, 1);
SetTimer is in where create the timer, "RandomMessage" is the name of the callback. (5000 = Five Seconds)
After, we create the forward which will call the callback:
Code:
Quote:forward RandomMessage(playerid);
public RandomMessage(playerid)
{
SendClientMessage(playerid, 0xFFFFFFFF,"Register at our forum! forum.sa-mp.com");
return 1;
}
You can create more timers using more stuff.. THis is just a basic tutorial. I hope it helps you...
|
|
|
Hey ;) |
Posted by: Peki - 04-13-2017, 10:28 AM - Forum: Self Introduction
- Replies (5)
|
|
Hello, my name is Pero, i'm from Serbia. I'm 20years old and i'm working in lear.com
I'm good with clients, I'm willing to help i know many languages like eng, german,russian,balkanian ofc..,and a little bit of a franch. That's it.
|
|
|
Staff Application! |
Posted by: HippoCampus- - 04-08-2017, 09:39 PM - Forum: Recruitment process of EHN
- Replies (5)
|
|
- Location (place of residence)alestine
- Full date of birth and age:4/7/2001-/ age = 16
- When did you join the community? Like 1 month ago but ik it from 1 year
- Why would you like to join the staff team? (255+ words):Yo, i wanna join Elites-Host Team To Help newbies and to show them rules about elites-host So, also iam active at forum to and Any help i will help them to fix servers and more info,, so no need 255+ also let me know if you need a help. I don't need any money for it just maybe some server i dont know we'll see.. And again im telling im available most of the day.finally, before this application gets too long, I would like to be a staff member in Elite-Host because I want to be a representing figure for your great servers, I want to contribute to the 10/10 staffing quality and overall i want too eventually become a possible mentor.,also have too many experience of becoming staff of an community,I also wanted to be a good and loyal staff of this host too since i joined this Hosting Community.[b]before this application gets too long, I would like to be a staff member in Elite-Host because I want to be a representing figure for your great servers, I want to contribute to the 10/10 staffing quality and overall i want too eventually become a possible mentor. [b]There has been occasions where there has been little staff on and as Member I can see how many people have been asking for help, [b]I do my best to follow the rules and make sure that players have the best experience possible. Another key factor that has persuaded me to apply for staff is the sometimes occurring lack of staff..Thanks[/b][/b][/b]
- E-mail address:mjd.omar.99@gmail.com
Job/professions: N/A
|
|
|
Peki's Staff Application |
Posted by: Peki - 04-01-2017, 09:24 PM - Forum: Recruitment process of EHN
- Replies (8)
|
|
- Location (place of residence): Serbia
- Full date of birth and age: 15.08.1996
- When did you join the community? A week ago
- Why would you like to join the staff team? (255+ words): I were thinking if you need game/voice support for your hosting, I'm available 24/7, if i'm not on computer im on a phone, i recieve a ticket notification and getting to computer or laptop. So what i know to do.. At the SA:MP i can do most of stuffs like scripting fixing errors doing gamemodes from 0 developing.. For cs 1.6 making plugins for "some mods" mostly of them are for jailbreak call of duty gun game and etc.. Call of duty just fixing errors, minecraft only with plugins, voice like teamspeak and ventrilo permissions there i'm best. In most cases i work fast. So let me know if you need a help. I don't need any money for it just maybe some server i dont know we'll see.. And again im telling im available most of the day. Thanks.
- E-mail address: pekiiz987@gmail.com
- Job/professions: www.lear.com in Serbia (city Novi Sad) If you asked about my current work well that's it, but if you asked what i know to do i already told, but shortly game(cod cs mc samp mw tf mta and etc..) and voice support(ts3, ventrilo)
- And yes i know that i don't have the following things like posts and etc. but i know how to work with clients. You can put me on test to see how i work with servers..
|
|
|
|