Wanted LeveL?
#1

Hallo....


How can i make a command with a_samp so if he not have the wanted level 2 he Can not use that command.

He need wanted level 2 for use a the command?
Reply
#2

pawn Код:
If(command...
{
    If(GetPlayerWantedLevel(playerid) < 2) return SendClientMessage(playerid, -1, "you need a wanted level of two for this command");
//command stuff
Does it work?
Reply
#3

ZCMD
pawn Код:
CMD:somecmd( playerid, params[ ] )
{
    if( GetPlayerWantedLevel( playerid ) < 2 ) return SendClientMessage( playerid, -1, "You need 2 wanted level in order to use this command!" );
    // rest of code
    return 1;
}
Reply
#4

It works in my commands but in my dialog with buy weapons Will it not work?



Its is to my dialog
Reply
#5

Simply create ur cmd like in zcmd...
pawn Код:
cmd: (playerid, params[]);
{
 if(GetPlayerWantedLevel(playerid) <=1) return SendClientMessage(playerid,color,"You need wanted level >1 to use this cmd");
//here ur cmd code
return 1;
}
Reply
#6

The. You need this:
pawn Код:
OnDialogResponse(...
{
      if (dialogid == weapondialog)
      (
           if(GetPlayerWantedLevel(playerid) > 2)
           (
// dialog stuff
Reply
#7

O.K...

But if i only want to have one of them like.

Код:
if(dialogid == DIALOG_BUYWEAPONS)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            if(listitem == 0) // They selected the first item - Desert Eagle
            {
                GivePlayerWeapon(playerid, WEAPON_DEAGLE, 50); // Give them a desert eagle
            }
            if(listitem == 1) // They selected the second item - AK-47
            {
                GivePlayerWeapon(playerid, 22, 50); // Give them an AK-47
            }
            if(listitem == 2) // They selected the third item - Desert Eagle
            {
                GivePlayerWeapon(playerid, 31, 750); // Give them a Combat Shotgun
                if(GetPlayerWantedLevel(playerid) > 2)
            }
        }
        return 1;
    }
But it will not work for me i get a error:
PHP код:
C:\Users\Canip\Desktop\Samp server\filterscripts\Gates.pwn(467) : error 036: empty statement 
Reply
#8

pawn Код:
if(listitem == 2) // They selected the third item - Desert Eagle
{
    GivePlayerWeapon(playerid, 31, 750); // Give them a Combat Shotgun
    if(GetPlayerWantedLevel(playerid) > 2)
}
You open an if statement and do nothing. Change to:
pawn Код:
if(listitem == 2) // They selected the third item - Desert Eagle
{
    if(GetPlayerWantedLevel(playerid) >= 2) GivePlayerWeapon(playerid, 31, 750); // Give them a Combat Shotgun
}
If their wanted level is 2 or greater than 2, then give the combat.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)