SA-MP Forums Archive
.:[Help]:. /cw Command. - 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: .:[Help]:. /cw Command. (/showthread.php?tid=568792)



.:[Help]:. /cw Command. - TuSheng - 25.03.2015

Hi Guys , I Got A Problem.
When I'm Admin And I Want To Check Player's Weapons & Ammo , But It Always Pop Up " * You Have No Permission To Use This Command !" But I'm An Admin , All Admin(Level) Can't Use That Command , Idk Why , I Tried To Solved But I'm A Newbie , So Someone Can Help Me To Let All Admins(Level) Can Use That Command? Thanks !

Sorry About My Bad English Btw.

Here Is My Code , Something Went Wrong?

PHP код:
CMD:cw(playeridparams[])
{
    if(
pInfo[playerid][Adminlevel] <= 0
    {
        new 
count 0;
        new 
ammoweaponidweapon[30], string26[150], id;
        if(!
sscanf(params"u"id))
        {
                for (new 
013c++)
                {
                    
GetPlayerWeaponData(idcweaponidammo);
                    if (
weaponid != && ammo != 0)
                    {
                        
count++;
                    }
                }
                
SendClientMessage(playeridCOLOR_ORANGE"||{FF8000}============={FFFF00} Weapons And Ammo {FF8000}===========||");
                if(
count 0)
                {
                    for (new 
013c++)
                    {
                        
GetPlayerWeaponData(idcweaponidammo);
                        if (
weaponid != && ammo != 0)
                        {
                            
GetWeaponName(weaponidweapon24);
                            
format(string26sizeof(string26), "Weapons: {A8FFA8}%s {FF0000}.:. {00FF00}Ammo: {A8FFA8}%d"weaponammo);
                            
SendClientMessage(playeridCOLOR_GREENstring26);
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED"* This Player Has No Weapons !");
                }
                return 
1;
        }
        else return 
SendClientMessage(playeridCOLOR_RED"[Usage]: /cw [PlayerID]");
    }
    else return 
SendClientMessage(playeridCOLOR_RED"* You Have No Permission To Use This Command !");




Re: .:[Help]:. /cw Command. - Mya - 25.03.2015

Try This, this is just for admin level 1 can use this command

PHP код:
CMD:cw(playeridparams[])
{
    if(
pInfo[playerid][Adminlevel] <= 1
    {
        new 
count 0;
        new 
ammoweaponidweapon[30], string26[150], id;
        if(!
sscanf(params"u"id))
        {
                for (new 
013c++)
                {
                    
GetPlayerWeaponData(idcweaponidammo);
                    if (
weaponid != && ammo != 0)
                    {
                        
count++;
                    }
                }
                
SendClientMessage(playeridCOLOR_ORANGE"||{FF8000}============={FFFF00} Weapons And Ammo {FF8000}===========||");
                if(
count 0)
                {
                    for (new 
013c++)
                    {
                        
GetPlayerWeaponData(idcweaponidammo);
                        if (
weaponid != && ammo != 0)
                        {
                            
GetWeaponName(weaponidweapon24);
                            
format(string26sizeof(string26), "Weapons: {A8FFA8}%s {FF0000}.:. {00FF00}Ammo: {A8FFA8}%d"weaponammo);
                            
SendClientMessage(playeridCOLOR_GREENstring26);
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED"* This Player Has No Weapons !");
                }
                return 
1;
        }
        else return 
SendClientMessage(playeridCOLOR_RED"[Usage]: /cw [PlayerID]");
    }
    else return 
SendClientMessage(playeridCOLOR_RED"* You Have No Permission To Use This Command !");




Re: .:[Help]:. /cw Command. - DeitY - 25.03.2015

if(pInfo[playerid][Adminlevel] <= 0)

Means that only people with Admin level 0 and below can use this command.

If u wish to every admin above level 1 and plus use this, simply

if(pInfo[playerid][Adminlevel] > 0)


Re: .:[Help]:. /cw Command. - TuSheng - 25.03.2015

Quote:
Originally Posted by Mya
Посмотреть сообщение
Try This, this is just for admin level 1 can use this command

PHP код:
CMD:cw(playeridparams[])
{
    if(
pInfo[playerid][Adminlevel] <= 1
    {
        new 
count 0;
        new 
ammoweaponidweapon[30], string26[150], id;
        if(!
sscanf(params"u"id))
        {
                for (new 
013c++)
                {
                    
GetPlayerWeaponData(idcweaponidammo);
                    if (
weaponid != && ammo != 0)
                    {
                        
count++;
                    }
                }
                
SendClientMessage(playeridCOLOR_ORANGE"||{FF8000}============={FFFF00} Weapons And Ammo {FF8000}===========||");
                if(
count 0)
                {
                    for (new 
013c++)
                    {
                        
GetPlayerWeaponData(idcweaponidammo);
                        if (
weaponid != && ammo != 0)
                        {
                            
GetWeaponName(weaponidweapon24);
                            
format(string26sizeof(string26), "Weapons: {A8FFA8}%s {FF0000}.:. {00FF00}Ammo: {A8FFA8}%d"weaponammo);
                            
SendClientMessage(playeridCOLOR_GREENstring26);
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED"* This Player Has No Weapons !");
                }
                return 
1;
        }
        else return 
SendClientMessage(playeridCOLOR_RED"[Usage]: /cw [PlayerID]");
    }
    else return 
SendClientMessage(playeridCOLOR_RED"* You Have No Permission To Use This Command !");

Thanks For Helping Me DeitY Solved My Problem , Anyway Thank You.

Quote:
Originally Posted by DeitY
Посмотреть сообщение
if(pInfo[playerid][Adminlevel] <= 0)

Means that only people with Admin level 0 and below can use this command.

If u wish to every admin above level 1 and plus use this, simply

if(pInfo[playerid][Adminlevel] > 0)
Thanks I Get It Now , Thanks For Helping Me :3

Sorry About My Bad/Poor English.