Cappsy!
Odáig eljutottam hogy sikerült találnom egy \"free weapon menu\" nevezetû scriptecskét ami valóban ad fegyvert, de
Csak is rendõrnek ad (mert az alap modban amúgy is van neki egy 1 shotija, 1 desert eagle je és egy parachute ja), tehát neki engedélyezve van a fegyver használat így a scriptben beálított fegyvereket meg is kapja úgymond \"nem veszi el tõle a mod\". De a scriptben nincs benne a teljes fegyver arzenál. Valahogy ki kéne agyalni hogy a menübõl elérhetõ legyen az összes fegyver ami gta ban van és hogy a parancsot csak adminok használhassák.
Meg tudjuk oldani?
u.i.: valahogy az anti cheatet kéne átvágni hogy classtól függetlenül admin bármikor fegyverhez juthasson. Ha gondolod össze beszélhetünk, feljössz szerveremre és megmutatom hogy tulajdonképpen hogy is mûködik ez a szerver
/*------------------------------------------------------------------------------
---------------------------------------------------
- -
- Weapons Menu 0.2 By Jasen [JA53N] -
- -
---------------------------------------------------
- Copyright ˆ 2007 JA53N
- Type - Filterscript
- Version 0.2
- Contact at [email protected]
------------------------------------------------------------------------------*/
#include <a_samp>
#include <float>
#define red 0xFF0000AA
#define yellow 0xFFFF00AA
new Menu:FWeapons;
new Menu:FPistols;
new Menu:FMicro_SMGs;
new Menu:FShotguns;
new Menu:FArmour;
new Menu:FSMG;
new Menu:FRifles;
new Menu:FAssault;
new Float:health;
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" [FS] Weapon\'s Menu by JA53N\");
print(\"--------------------------------------\\n\");
FWeapons = CreateMenu(\"Weapons\",1,20,120,150,40);
AddMenuItem(FWeapons,0,\"Pistols\");
AddMenuItem(FWeapons,0,\"Micro SMGs\");
AddMenuItem(FWeapons,0,\"Shotguns\");
AddMenuItem(FWeapons,0,\"Armour\");
AddMenuItem(FWeapons,0,\"SMG\");
AddMenuItem(FWeapons,0,\"Rifles\");
AddMenuItem(FWeapons,0,\"Assault\");
FPistols = CreateMenu(\"Weapons\",1,20,120,150,40);
SetMenuColumnHeader(FPistols,0,\"Weapons\");
AddMenuItem(FPistols,0,\"9mm\");
AddMenuItem(FPistols,0,\"Silenced 9mm\");
AddMenuItem(FPistols,0,\"Desert Eagle\");
AddMenuItem(FPistols,0,\"<back>\");
FMicro_SMGs = CreateMenu(\"Weapons\",1,20,120,150,40);
SetMenuColumnHeader(FMicro_SMGs,0,\"Weapons\");
AddMenuItem(FMicro_SMGs,0,\"Tec9\");
AddMenuItem(FMicro_SMGs,0,\"Micro SMG\");
AddMenuItem(FMicro_SMGs,0,\"<back>\");
FShotguns = CreateMenu(\"Weapons\",1,20,120,150,40);
SetMenuColumnHeader(FShotguns,0,\"Weapons\");
AddMenuItem(FShotguns,0,\"Shotgun\");
AddMenuItem(FShotguns,0,\"Sawnoff Shotgun\");
AddMenuItem(FShotguns,0,\"<back>\");
FArmour = CreateMenu(\"Weapons\",1,20,120,150,40);
SetMenuColumnHeader(FArmour,0,\"Weapons\");
AddMenuItem(FArmour,0,\"Body Armour\");
AddMenuItem(FArmour,0,\"<back>\");
FSMG = CreateMenu(\"Weapons\",1,20,120,150,40);
SetMenuColumnHeader(FSMG,0,\"Weapons\");
AddMenuItem(FSMG,0,\"SMG\");
AddMenuItem(FSMG,0,\"<back>\");
FRifles = CreateMenu(\"Weapons\",1,20,120,150,40);
SetMenuColumnHeader(FRifles,0,\"Weapons\");
AddMenuItem(FRifles,0,\"Rifle\");
AddMenuItem(FRifles,0,\"Sniper Rifle\");
AddMenuItem(FRifles,0,\"<back>\");
FAssault = CreateMenu(\"Weapons\",1,20,120,150,40);
SetMenuColumnHeader(FAssault,0,\"Weapons\");
AddMenuItem(FAssault,0,\"AK47\");
AddMenuItem(FAssault,0,\"M4\");
AddMenuItem(FAssault,0,\"<back>\");
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, \"/wm\", true) == 0)
{
GetPlayerHealth(playerid, health);
GetPlayerHealth(playerid, Float:health);
TogglePlayerControllable(playerid, false);
SetPlayerHealth(playerid, 100000);
ShowMenuForPlayer(FWeapons, playerid);
return 1;
}
return 0;
}
public OnFilterScriptExit()
{
DestroyMenu(Menu:FWeapons);
DestroyMenu(Menu:FPistols);
DestroyMenu(Menu:FMicro_SMGs);
DestroyMenu(Menu:FShotguns);
DestroyMenu(Menu:FArmour);
DestroyMenu(Menu:FSMG);
DestroyMenu(Menu:FRifles);
DestroyMenu(Menu:FAssault);
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \'))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:Current = GetPlayerMenu(playerid);
if(Current == FWeapons) {
switch(row){
case 0:
if(IsPlayerConnected(playerid))
{
ShowMenuForPlayer(FPistols, playerid);
}
case 1:
if(IsPlayerConnected(playerid))
{
ShowMenuForPlayer(FMicro_SMGs, playerid);
}
case 2:
if(IsPlayerConnected(playerid))
{
ShowMenuForPlayer(FShotguns, playerid);
}
case 3:
if(IsPlayerConnected(playerid))
{
ShowMenuForPlayer(FArmour, playerid);
}
case 4:
if(IsPlayerConnected(playerid))
{
ShowMenuForPlayer(FSMG, playerid);
}
case 5:
if(IsPlayerConnected(playerid))
{
ShowMenuForPlayer(FRifles, playerid);
}
case 6:
if(IsPlayerConnected(playerid))
{
ShowMenuForPlayer(FAssault, playerid);
}
}
}
if(Current == FPistols) {
switch(row){
case 0:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 22, 500);
SendClientMessage(playerid,yellow,\"9mm Succsesful!\");
GetPlayerWeapon(playerid);
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 1:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 23, 500);
SendClientMessage(playerid,yellow,\"Silenced 9mm Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 2:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 24, 500);
SendClientMessage(playerid,yellow,\"Desert Eagle Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 3:ShowMenuForPlayer(FWeapons, playerid);
}
}
if(Current == FMicro_SMGs) {
switch(row){
case 0:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 32, 500);
SendClientMessage(playerid,yellow,\"Tec9 Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 1:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 28, 60);
SendClientMessage(playerid,yellow,\"Micro SMG Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 2:ShowMenuForPlayer(FWeapons, playerid);
}
}
if(Current == FShotguns) {
switch(row){
case 0:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 25, 500);
SendClientMessage(playerid,yellow,\"Shotgun Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 1:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 26, 500);
SendClientMessage(playerid,yellow,\"Sawnoff Shotgun Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 2:ShowMenuForPlayer(FWeapons, playerid);
}
}
if(Current == FArmour) {
switch(row){
case 0:
if(GetPlayerMoney(playerid) >= 0)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid,yellow,\"Body Armour Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 1:ShowMenuForPlayer(FWeapons, playerid);
}
}
if(Current == FSMG) {
switch(row){
case 0:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 29, 500);
SendClientMessage(playerid,yellow,\"SMG Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 1:ShowMenuForPlayer(FWeapons, playerid);
}
}
if(Current == FRifles) {
switch(row){
case 0:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 33, 500);
SendClientMessage(playerid,yellow,\"Rifle Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 1:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 34, 500);
SendClientMessage(playerid,yellow,\"Sniper Rifle Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 2:ShowMenuForPlayer(FWeapons, playerid);
}
}
if(Current == FAssault) {
switch(row){
case 0:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 30, 500);
SendClientMessage(playerid,yellow,\"AK47 Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 1:
if(GetPlayerMoney(playerid) >= 0)
{
GivePlayerWeapon(playerid, 31, 500);
SendClientMessage(playerid,yellow,\"M4 Succsesful!\");
ShowMenuForPlayer(FWeapons, playerid);
}
else
{
SendClientMessage(playerid,red,\"Not enough money!\");
ShowMenuForPlayer(FWeapons, playerid);
}
case 2:ShowMenuForPlayer(FWeapons, playerid);
}
}
}
public OnPlayerExitedMenu(playerid)
{
TogglePlayerControllable(playerid, true);
(SetPlayerHealth(playerid, Float:health));
}