Weapon dialog prob!
#1

hey this is my first dialog script and it seems ok...
the problem is that all of the wepon are on the same line so i can only spawn the minigun
heres the script
Код:
/*

*******************************************************
Dialog/Command based Weapon Spawner by FusiouS
Version: 1.1, Release 2 (Admins only version)
SA-MP Version: 0.3 Compatible (including newest 0.3c)
Credits: FusiouS
*******************************************************

				Features:
- Dialog/Command based weapon spawning.
- Guns in Weapon ID number order (Starting from 4-)
- Currently working for all users, can be easily changed for RCON admins only.
- Contains most used weapons in SA-MP.


			How to install & use:
				
1) Download package and place .pwn file to your filterscripts folder
2) Compile .pwn file to .amx and write to your server.cfg behind filterscripts: weapons
3) Start your server and login as RCON admin
4) Type /weapons and weapon list appears. Choose your weapon and press "spawn"


TERMS OF USE: You are free to modify this script for your OWN use only. DO NOT remove credits or re-release this as your own work.              */

#include <a_samp>
#define weapons 4670
#pragma tabsize 0

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Weapon Spawner by FusiouS loaded ");
print(" Version: 1.1, Release 2");
print("--------------------------------------");
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/weapons", true))

{
   ShowPlayerDialog(playerid, weapons, DIALOG_STYLE_LIST, "Weapon Spawner", "MiniGun/nFlameThrowe/nM4", "Spawn", "Cancel");
   return 1;
}

return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == weapons)
{
   switch(listitem)
   {
          case 0:
	    {
		    GivePlayerWeapon(playerid,38,9999)
	    }
	    case 1:
	    {
			 GivePlayerWeapon(playerid,37,9999)
	    }
	    case 2:
	    {
			GivePlayerWeapon(playerid,31,9999)
	    }
	   
   }
}
return 1;
}
hope u can help quick thanks!
Reply
#2

Here it is:
pawn Код:
/*

*******************************************************
Dialog/Command based Weapon Spawner by FusiouS
Version: 1.1, Release 2 (Admins only version)
SA-MP Version: 0.3 Compatible (including newest 0.3c)
Credits: FusiouS
*******************************************************

                Features:
- Dialog/Command based weapon spawning.
- Guns in Weapon ID number order (Starting from 4-)
- Currently working for all users, can be easily changed for RCON admins only.
- Contains most used weapons in SA-MP.


            How to install & use:
               
1) Download package and place .pwn file to your filterscripts folder
2) Compile .pwn file to .amx and write to your server.cfg behind filterscripts: weapons
3) Start your server and login as RCON admin
4) Type /weapons and weapon list appears. Choose your weapon and press "spawn"


TERMS OF USE: You are free to modify this script for your OWN use only. DO NOT remove credits or re-release this as your own work.              */


#include <a_samp>
#define weapons 4670
#pragma tabsize 0

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Weapon Spawner by FusiouS loaded ");
print(" Version: 1.1, Release 2");
print("--------------------------------------");
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/weapons", true))

{
   ShowPlayerDialog(playerid, weapons, DIALOG_STYLE_LIST, "Weapon Spawner", "MiniGun\nFlameThrowe\nM4", "Spawn", "Cancel");
   return 1;
}

return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == weapons)
{
   switch(listitem)
   {
          case 0:
        {
            GivePlayerWeapon(playerid,38,9999)
        }
        case 1:
        {
             GivePlayerWeapon(playerid,37,9999)
        }
        case 2:
        {
            GivePlayerWeapon(playerid,31,9999)
        }
       
   }
}
return 1;
}
The problem was that you used "/n" for a new line. It should be "\n"

pawn Код:
ShowPlayerDialog(playerid, weapons, DIALOG_STYLE_LIST, "Weapon Spawner", "MiniGun\nFlameThrowe\nM4", "Spawn", "Cancel");//I changed the "/n" to "\n"
Reply
#3

thanks man but what as wrong?
Reply
#4

Sorry i edited the post, look below your script and at the last script (scroll to the right on the last script).
Reply
#5

oh wrong slash thanks man but one more thing why does the flamethrower replace the mini gun vice versa
Reply
#6

What you mean? When you click Flamethrower you get minigun?
Reply
#7

Quote:
Originally Posted by a!DaN)_)-)
Посмотреть сообщение
oh wrong slash thanks man but one more thing why does the flamethrower replace the mini gun vice versa
because there both heavy weapons so they will replace one another just like a rocket launcher would replace flamethrower
Reply
#8

ok nice 1 guys next its a register system lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)