SA-MP Forums Archive
[FilterScript] TPGun - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] TPGun (/showthread.php?tid=268402)



TPGun - Sreadon - 12.07.2011

Hi,
Today I release my first FilterScript, It's a really simple FilterScript but usefull in DeathMatch GameModes..
You can easily edit it, if you have any suggestions, post here, I'll make my possible to do them but I'm a new scripter in Pawn.

It's a menu with:
->Weapon menu
->Cars Menu
->Teleport Menu

Just type in game : /menu.

Screens:

http://hpics.li/a27da1d
http://hpics.li/7689a55
http://hpics.li/3986bc4

Links:
SolidFiles : http://solidfiles.com/d/61ab/
PasteBin: http://pastebin.com/FQ99gxzh


Re: TPGun - BizzyD - 12.07.2011

Very nice for your first :P Keep it up


Re : TPGun - Sreadon - 12.07.2011

Thank's


Re: TPGun - soulas85 - 14.07.2011

Where should i put this line:

Код:
if(playerDB[playerid][admin])
so that only admins could use this cmd


Re : TPGun - Sreadon - 14.07.2011

Replace the original script for the command menu by:

pawn Код:
COMMAND:menu(playerid, params[])
    if(IsPlayerConnected(playerid) && IsPlayerAdmin(playerid))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What do you want?", "Gun Shop \nVehicles Shop \nTeleport Destinations", "Buy", "Cancel");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_INFO, "You must be RCON login to use this command!");
        return 1;
    }
So, after this, you will need to be RCON login to use the command.


Re: TPGun - soulas85 - 14.07.2011

but i want that all admins could us it, not only with rcon. Is it possible?


AW: TPGun - Forbidden - 14.07.2011

Make a enum e.x enum Playerinfo {Adminlvl} usw SetPVars and use for example CMD:Hey......If(Playerinfo[Adminlvl]=1 or something else


Re: TPGun - ricardo178 - 14.07.2011

Give us your Admin variable...
But then you need to incorporate this script ino your gamemode...


AW: TPGun - Forbidden - 14.07.2011

He just ask about one ,ricardo...But if you want to make one ,its simple ,if not ask wiki.


Re: TPGun - soulas85 - 14.07.2011

Quote:
Originally Posted by soulas85
Посмотреть сообщение
Where should i put this line:

Код:
if(playerDB[playerid][admin])
so that only admins could use this cmd
my server recognizes admin with this.


Re : TPGun - Sreadon - 14.07.2011

Past here an admin command of your gamemode please.


Re: TPGun - soulas85 - 14.07.2011

PHP код:
if(!strcmp("/telvm"cmdtexttrue))
{
    if(
playerDB[playerid][admin] || playerDB[playerid][vip])
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new 
veh GetPlayerVehicleID(playerid);
            
SetVehiclePos(veh, -1994.4752, -83.904235.8087);
            
SetVehicleVirtualWorld(veh0);
            
LinkVehicleToInterior(veh0);
            
SetPlayerInterior(playerid0);
            
SetPlayerVirtualWorld(playerid0);
            
PutPlayerInVehicle(playeridveh0);
        }
        else
        {
            
SetPlayerPos(playerid, -1994.4752, -83.904235.8087);
            
SetPlayerInterior(playerid0);
            
SetPlayerVirtualWorld(playerid0);
        }
    }
    return 
1;




Re : TPGun - Sreadon - 14.07.2011

pawn Код:
COMMAND:menu(playerid, params[])
    if(playerDB[playerid][admin] || playerDB[playerid][vip]) // If player is admin or VIP.
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What do you want?", "Gun Shop \nVehicles Shop \nTeleport Destinations", "Buy", "Cancel");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_INFO, "You must be administrator or VIP to use this command!");
        return 1;
    }
That might work.. But, you will need to implement the FS in your gamemode... So if you use the "basic" system command in your gamemode, you will need to replace the command by this:

pawn Код:
if(!strcmp("/menu", cmdtext, true))
{  
    if(playerDB[playerid][admin] || playerDB[playerid][vip]) // If player is admin or VIP.
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What do you want?", "Gun Shop \nVehicles Shop \nTeleport Destinations", "Buy", "Cancel");
    }
    else
    {
        SendClientMessage(playerid, COLOR_INFO, "You must be administrator or VIP to use this command!");
    }
    return 1;
}