Weapon dialog prob!
#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


Messages In This Thread
Weapon dialog prob! - by a!DaN)_)-) - 06.02.2011, 23:52
Re: Weapon dialog prob! - by Tee - 06.02.2011, 23:57
Re: Weapon dialog prob! - by a!DaN)_)-) - 06.02.2011, 23:59
Re: Weapon dialog prob! - by Tee - 07.02.2011, 00:02
Re: Weapon dialog prob! - by a!DaN)_)-) - 07.02.2011, 00:09
Re: Weapon dialog prob! - by Tee - 07.02.2011, 00:14
Re: Weapon dialog prob! - by TheYoungCapone - 07.02.2011, 00:15
Re: Weapon dialog prob! - by a!DaN)_)-) - 07.02.2011, 00:16

Forum Jump:


Users browsing this thread: 2 Guest(s)