Spawna weapons somewhere at map
#1

hey when you save a characters' coordinates you can add 3 weapons to him but, is it possible to script so it'll spawn some weapons at the map , like a sniper on a rooftop? if its possible how will i script and what shall i script? i've been searching for a script like that for a while now but couldnt find one. so if you can make one or send me a link to a site where i can find it it would be nice

you can write here or pm me if you want to help me
Reply
#2

Example
Код:
new Weapon1; // Create a variable to store the pickup ID in
new Weapon2; // Create a variable to store the pickup ID in
new Weapon3; // Create a variable to store the pickup ID in
new Weapon4; // Create a variable to store the pickup ID in
new Weapon5; // Create a variable to store the pickup ID in


public OnGameModeInit()
{
    Weapon1 = CreatePickup(1242, 2, 4.3359, 1432.3585, 10.1191, -1);
    Weapon2 = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);
    Weapon3 = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);
    Weapon4 = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);
    Weapon5 = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);
    return 1;
}
Reply
#3

hey again, i got some warnings, any idea of how to fix it?

C:\Users\Admin\Downloads\GTA San Andreas\egen dm-server\gamemodes\holiwoodstar_2.pwn(466) : warning 204: symbol is assigned a value that is never used: "Weapon1"
C:\Users\Admin\Downloads\GTA San Andreas\egen dm-server\gamemodes\holiwoodstar_2.pwn(467) : warning 204: symbol is assigned a value that is never used: "Weapon2"
C:\Users\Admin\Downloads\GTA San Andreas\egen dm-server\gamemodes\holiwoodstar_2.pwn(46 : warning 204: symbol is assigned a value that is never used: "Weapon3"
C:\Users\Admin\Downloads\GTA San Andreas\egen dm-server\gamemodes\holiwoodstar_2.pwn(469) : warning 204: symbol is assigned a value that is never used: "Weapon4"
C:\Users\Admin\Downloads\GTA San Andreas\egen dm-server\gamemodes\holiwoodstar_2.pwn(470) : warning 204: symbol is assigned a value that is never used: "Weapon5"
Reply
#4

is there anyone who can help me with these warnings?
Reply
#5

Yeah and you have to make :
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickupid == weapon1)
 	{
	GivePlayerWeapon(playerid,21,1000);
	}
	if (pickupid == weapon2)
 	{
	GivePlayerWeapon(playerid,22,1000);
	}
	if (pickupid == weapon3)
 	{
	GivePlayerWeapon(playerid,23,1000);
	}
	if (pickupid == weapon4)
 	{
	GivePlayerWeapon(playerid,24,1000);
	}
	if (pickupid == weapon5)
 	{
	GivePlayerWeapon(playerid,25,1000);
	}
	
	return 1;

}
Reply
#6

Isnt it easier to add ongamemodeinit :
pawn Код:
AddStaticPickup(1242,3,2522.4668,-1701.8077,16.6744);
this will spawn some armor near the groove st.
Reply
#7

Quote:
Originally Posted by MarkoN
Посмотреть сообщение
Isnt it easier to add ongamemodeinit :
pawn Код:
AddStaticPickup(1242,3,2522.4668,-1701.8077,16.6744);
this will spawn some armor near the groove st.
is it possible to change spawn place at the map if i do your way? or is it already decided where they will spawn
Reply
#8

Quote:
Originally Posted by jake_peterson
Посмотреть сообщение
is it possible to change spawn place at the map if i do your way? or is it already decided where they will spawn
yes heres how it works : (model, type, Float:X, Float:Y, Float:Z, Virtualworld)

You can use MTA Map editor and add pickups were you want , and then go to www.convertffs.com and just convert them and add to youre gamemode
Reply
#9

Quote:
Originally Posted by MarkoN
Посмотреть сообщение
yes heres how it works : (model, type, Float:X, Float:Y, Float:Z, Virtualworld)
what means with "Virtual World"?
Reply
#10

Quote:
Originally Posted by jake_peterson
Посмотреть сообщение
what means with "Virtual World"?
Virtual wolrd means .... If the virtual world is 0 , every player in virtual player 0 can see each other , but if one player has virtual world 0 and the other has 1 they cant see each other

Quote:
Originally Posted by jake_peterson
Посмотреть сообщение
can i just add 5 weapons or can i add more than that?
Just download MTA , and use the Map Editor to add pickups and convert it with convertffs.com
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)