A few questions.
#1

Hello everyone, I am kinda new to scripting and I got really into it. So I have a few questions which I don't seem to be able to figure out myself, first of all thank you in advance to all those who will answer.

1. How to create a DM area, which when a player will get into it will get specific weapons (I know how to do that), but
when he will leave his weapons will return to default (The once he had before) no matter to which area will he teleport.

2. How to make it possible to use let's say a /buyguns cmd, only near a specific place I'll choose. (Let's say a gun store).

3. How can I make a race? (Checkpoints changing, I can create one but I can't make it lead to the second one..)

That's all for now...thanks in advance again.
Reply
#2

1:
pawn Код:
new PlayerPrevWeapon[MAX_PLAYERS][12]; //put these 2 above most of your script; put them above main().
new PlayerPrevAmmo[MAX_PLAYERS][12];

//Use the above variables before he enters the arena; it will be like..

for(new i=0;i<12;i++)
{
    GetPlayerWeaponData(playerid, i, PlayerPrevWeapon[playerid][i],  PlayerPrevWeapon[playerid][i]);
}
2: Go to where you want the person to be at and type /save /buygun position.
Go to GTA San Andreas User Files -> SAMP -> Savepositions and post the X/Y/Z from the line into the below function. Also; you can put radius as something like 5.0.
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:radius,Float:x,Float:y,Float:z);
3: Use this callback. EDIT: Read what Kon posted
pawn Код:
OnPlayerEnterRaceCheckpoint(playerid)
Reply
#3

1. To where they join to DM, use GetPlayerWeaponData and store the player's weapon data into some arrays. Resets the weapons, give the weapons you want. When it's about to exit, reset the weapons and use a for loop like the example of GetPlayerWeaponData but use GivePlayerWeapon to give the weapons the player had.

2. When they execute /buyguns, check if they are in range of the coordinates you want. You can use IsPlayerInRangeOfPoint for that.

3. I've recently given an example for that (It can be found here: http://forum.sa-mp.com/showpost.php?...15&postcount=2)
However, it's for one race, like I said to that post. You need another array that handles the raceid.
Reply
#4

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
1:
pawn Код:
new PlayerPrevWeapon[MAX_PLAYERS][12]; //put these 2 above most of your script; put them above main().
new PlayerPrevAmmo[MAX_PLAYERS][12];

//Use the above variables before he enters the arena; it will be like..

for(new i=0;i<12;i++)
{
    GetPlayerWeaponData(playerid, i, PlayerPrevWeapon[playerid][i],  PlayerPrevWeapon[playerid][i]);
}
2: Go to where you want the person to be at and type /save /buygun position.
Go to GTA San Andreas User Files -> SAMP -> Savepositions and post the X/Y/Z from the line into the below function. Also; you can put radius as something like 5.0.
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:radius,Float:x,Float:y,Float:z);
3: Use this callback. EDIT: Read what Kon posted
pawn Код:
OnPlayerEnterRaceCheckpoint(playerid)
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
1. To where they join to DM, use GetPlayerWeaponData and store the player's weapon data into some arrays. Resets the weapons, give the weapons you want. When it's about to exit, reset the weapons and use a for loop like the example of GetPlayerWeaponData but use GivePlayerWeapon to give the weapons the player had.

2. When they execute /buyguns, check if they are in range of the coordinates you want. You can use IsPlayerInRangeOfPoint for that.

3. I've recently given an example for that (It can be found here: http://forum.sa-mp.com/showpost.php?...15&postcount=2)
However, it's for one race, like I said to that post. You need another array that handles the raceid.
Thanks, and thanks I'll start trying
Reply
#5

2_
with dialogs you can create it
3_
maybe with this web page you may make a good race
http://codegenerators.pl/race
there you can create a race
Reply
#6

1.

You can use my tutorial or download my script


Tutorial

Script for rocket and sniper deathmach
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)