SA-MP Forums Archive
Wanted LeveL? - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Wanted LeveL? (/showthread.php?tid=463176)



Wanted LeveL? - Lynet - 10.09.2013

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?


Re: Wanted LeveL? - knackworst - 10.09.2013

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?


Re: Wanted LeveL? - Konstantinos - 10.09.2013

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;
}



Respuesta: Wanted LeveL? - Lynet - 10.09.2013

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



Its is to my dialog


Re: Wanted LeveL? - PrinceKumar - 10.09.2013

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;
}



Re: Wanted LeveL? - knackworst - 10.09.2013

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



Re: Wanted LeveL? - Lynet - 10.09.2013

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 



Re: Wanted LeveL? - Konstantinos - 10.09.2013

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.