weapon pack help needed!
#1

Код:
if(strcmp(cmd, "/weaponpackadmin", true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
        SetPlayerarmor(playerid,100.0);
        GivePlayerWeapon(playerid, 24, 10000);
        GivePlayerWeapon(playerid, 32, 10000);
        GivePlayerWeapon(playerid, 36, 10000);
        GivePlayerWeapon(playerid, 3, 10000);
        GivePlayerWeapon(playerid, 27, 10000);
        GivePlayerWeapon(playerid, 41, 10000);
        }
    return 1;
    }
what did i do wrong can some1 help me!
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/weaponpackadmin", true) == 0)
{
  if(IsPlayerAdmin(playerid))
  {
  SetPlayerarmor(playerid,100.0);
  GivePlayerWeapon(playerid, 24, 10000);
  GivePlayerWeapon(playerid, 32, 10000);
  GivePlayerWeapon(playerid, 36, 10000);
  GivePlayerWeapon(playerid, 3, 10000);
  GivePlayerWeapon(playerid, 27, 10000);
  GivePlayerWeapon(playerid, 41, 10000);
  return 1;
  }
Reply
#3

it doesnt work :S i login as rcon admin and try but bam unknown command can you make it all from scratch? something wrong in the script
Reply
#4

i need 1 to re-edit my command or re-make it doesnt work!
Reply
#5

Quote:
Originally Posted by guaid
i need 1 to re-edit my command or re-make it doesnt work!
I can do it.

EDIT: Here you go
pawn Код:
if (strcmp(cmdtext, "/adminweaponpack", true) == 0)
{
      if(IsPlayerAdmin(playerid))
      {
            SetPlayerArmour(playerid, 100);
            GivePlayerWeapon(playerid, 24, 10000);
            GivePlayerWeapon(playerid, 32, 10000);
            GivePlayerWeapon(playerid, 36, 10000);
            GivePlayerWeapon(playerid, 3, 10000);
            GivePlayerWeapon(playerid, 27, 10000);
            GivePlayerWeapon(playerid, 41, 10000);
        }
        return 1;
        }
Reply
#6

pawn Код:
if(strcmp(cmdtext, "/weaponpackadmin", true) == 0)
{
 if(IsPlayerAdmin(playerid))
 {
   SetPlayerArmour(playerid,100.0);
   GivePlayerWeapon(playerid, 24, 10000);
   GivePlayerWeapon(playerid, 32, 10000);
   GivePlayerWeapon(playerid, 36, 10000);
   GivePlayerWeapon(playerid, 3, 10000);
   GivePlayerWeapon(playerid, 27, 10000);
   GivePlayerWeapon(playerid, 41, 10000);
   return 1;
 }
 else
 {
   SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command As You Are Not Admin!"
   return 1;
 }
 return 1;
}
that should work.
Reply
#7

ill try
Reply
#8

Quote:
Originally Posted by <__Ǝthan__>
pawn Код:
if(strcmp(cmdtext, "/weaponpackadmin", true) == 0)
{
 if(IsPlayerAdmin(playerid))
 {
   SetPlayerArmour(playerid,100.0);
   GivePlayerWeapon(playerid, 24, 10000);
   GivePlayerWeapon(playerid, 32, 10000);
   GivePlayerWeapon(playerid, 36, 10000);
   GivePlayerWeapon(playerid, 3, 10000);
   GivePlayerWeapon(playerid, 27, 10000);
   GivePlayerWeapon(playerid, 41, 10000);
   return 1;
 }
 else
 {
   SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command As You Are Not Admin!"
   return 1;
 }
 return 1;
}
that should work.
The whole point of an else statement is so you dont have to return 1, So i think the compiler would bitch about that, Try this
[quote=<__Ǝthan__> ]
pawn Код:
if(strcmp(cmdtext, "/weaponpackadmin", true) == 0)
{
 if(IsPlayerAdmin(playerid))
 {
   SetPlayerArmour(playerid,100.0);
   GivePlayerWeapon(playerid, 24, 10000);
   GivePlayerWeapon(playerid, 32, 10000);
   GivePlayerWeapon(playerid, 36, 10000);
   GivePlayerWeapon(playerid, 3, 10000);
   GivePlayerWeapon(playerid, 27, 10000);
   GivePlayerWeapon(playerid, 41, 10000);
 }
 else
 {
   SendClientMessage(playerid, color, "You Cannot Use This Command As You Are Not Admin!"); // Replace color with a color of your choice
 }
 return 1;
}
Reply
#9

oh ok, sorry. i like to return after all ifs.
Reply
#10

ok when i found it should i make it to an fs?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)