SA-MP Forums Archive
/giveweapon change 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: /giveweapon change level (/showthread.php?tid=327234)



/giveweapon change level - [FoR]EveR - 20.03.2012

pawn Code:
CMD:giveweapon(playerid,params[])
{
    new pAdmin[MAX_PLAYERS];
    if(pAdmin[playerid] <= 4 && !IsPlayerAdmin(playerid)) // If they are not RCON admin
    {
        // Then it sends this message
        SendClientMessage(playerid,-1,"You are not authorised to use this command.");
        return 1;
    }
    new
        weaponid,
        targetid,
        ammo;

    if(sscanf(params,"uii",targetid,weaponid,ammo))
    {
        // If they typed the command wrong then show them this
        SendClientMessage(playerid,-1,"USAGE: /giveweapon [playerid] [weaponid] [ammo]");
        return 1;
    }
    else
    {
        GivePlayerWeapon(targetid,weaponid,ammo);
        return 1;
    }
}
How to change for level 2 admin?


Re: /giveweapon change level - .FuneraL. - 20.03.2012

pawn Code:
CMD:giveweapon(playerid,params[])
{
    new pAdmin[MAX_PLAYERS];
    if(pAdmin[playerid] <= 2 && !IsPlayerAdmin(playerid)) // If they are not RCON admin
    {
        // Then it sends this message
        SendClientMessage(playerid,-1,"You are not authorised to use this command.");
        return 1;
    }
    new
        weaponid,
        targetid,
        ammo;

    if(sscanf(params,"uii",targetid,weaponid,ammo))
    {
        // If they typed the command wrong then show them this
        SendClientMessage(playerid,-1,"USAGE: /giveweapon [playerid] [weaponid] [ammo]");
        return 1;
    }
    else
    {
        GivePlayerWeapon(targetid,weaponid,ammo);
        return 1;
    }
}
Changed To Level 2 Admin.


Re: /giveweapon change level - ]Rafaellos[ - 20.03.2012

pawn Code:
CMD:giveweapon(playerid,params[])
{
    new pAdmin[MAX_PLAYERS];
    if(pAdmin[playerid] <= 2 && !IsPlayerAdmin(playerid)) // If they are not RCON admin
    {
        // Then it sends this message
        SendClientMessage(playerid,-1,"You are not authorised to use this command.");
        return 1;
    }
    new
        weaponid,
        targetid,
        ammo;

    if(sscanf(params,"uii",targetid,weaponid,ammo))
    {
        // If they typed the command wrong then show them this
        SendClientMessage(playerid,-1,"USAGE: /giveweapon [playerid] [weaponid] [ammo]");
        return 1;
    }
    else
    {
        GivePlayerWeapon(targetid,weaponid,ammo);
        return 1;
    }
}



Re: /giveweapon change level - [FoR]EveR - 20.03.2012

Thanks You. Now i have problem when anyone conneect now is Trucking server i want change to Player (name) (id) Connected to International Trucking


Re: /giveweapon change level - .FuneraL. - 20.03.2012

Quote:
Originally Posted by [FoR]EveR
View Post
Thanks You. Now i have problem when anyone conneect now is Trucking server i want change to Player (name) (id) Connected to International Trucking
Use This Code for Show Message :

pawn Code:
new var0[201];
new var1[256];
new var2[256];
GetPlayerIp(playerid, var2, 256);
GetPlayerName(playerid, var0, 201);
format(var1, 256, "{828282}===> %s [ ID: %d ] Entered In Server [ IP: %s ] <===", var0, playerid, var2);
SendClientMessageToAll(0xBBC8CBAA, var1);



Re: /giveweapon change level - ]Rafaellos[ - 20.03.2012

Give your code.


Re: /giveweapon change level - [FoR]EveR - 20.03.2012

okey But /giveweapon is only for rcon admins not for level 2


Re: /giveweapon change level - .FuneraL. - 20.03.2012

Quote:
Originally Posted by [FoR]EveR
View Post
okey But /giveweapon is only for rcon admins not for level 2
Try so Then :

pawn Code:
CMD:giveweapon(playerid,params[])
{
    new pAdmin[MAX_PLAYERS];
    if(pAdmin[playerid] <= 2))
    {
        // Then it sends this message
        SendClientMessage(playerid,-1,"You are not authorised to use this command.");
        return 1;
    }
    new
        weaponid,
        targetid,
        ammo;

    if(sscanf(params,"uii",targetid,weaponid,ammo))
    {
        // If they typed the command wrong then show them this
        SendClientMessage(playerid,-1,"USAGE: /giveweapon [playerid] [weaponid] [ammo]");
        return 1;
    }
    else
    {
        GivePlayerWeapon(targetid,weaponid,ammo);
        return 1;
    }
}



Re: /giveweapon change level - [FoR]EveR - 20.03.2012

1 error
pawn Code:
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(181) : warning 225: unreachable code
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(181) : warning 217: loose indentation
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(184) : warning 217: loose indentation
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(778) : warning 217: loose indentation
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(1499) : error 029: invalid expression, assumed zero
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(1505) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.



Re: /giveweapon change level - .FuneraL. - 20.03.2012

pawn Code:
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(181) : warning 225: unreachable code // The Code is not available for access in Mode
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(181) : warning 217: loose indentation // Poorly Indented Lines
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(184) : warning 217: loose indentation // Poorly Indented Lines
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(778) : warning 217: loose indentation // Poorly Indented Lines
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(1499) : error 029: invalid expression, assumed zero
C:\Documents and Settings\rado\Desktop\truck server\gamemodes\PPC_Trucking.pwn(1505) : warning 225: unreachable code // The Code is not available for access in Mode
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Modified , Have observations in the Final Line.