Someone help meh pl0x
#1

Hey i have this code : if(GetPlayerWeapon(playerid) == WEAPON_M4) {
SetPlayerHealth(playerid,0);
SendClientMessage(playerid,0xAA3333AA,"you don't realy need gun's on a drift server..");
return 0;
}


What would i have to do to it so it's admin's only that can use this weapon?

Thank's

-Noddi3
Reply
#2

pawn Код:
if((GetPlayerWeapon(playerid) == WEAPON_M4) && (!IsPlayerAdmin(playerid)))
{
  SetPlayerHealth(playerid, 0);
  SendClientMessage(playerid, 0xAA3333AA, "you don't realy need gun's on a drift server..");
  return 0;
}
Reply
#3

You will have to set a timer...

just use

if(GetPlayerWeapon(playerid) == WEAPON_M4)
{
if(IsPlayerAdmin(playerid))
{
//something
}
else
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid,0xAA3333AA,"you don't realy need gun's on a drift server..");
return 0;
}


Plz note that i typed this up right now, so it isnt tested =P

Reply
#4

pawn Код:
if(GetPlayerWeapon(playerid) == WEAPON_M4 && !IsPlayerAdmin(playerid))
Reply
#5

Quote:
Originally Posted by |∞|-Рцппσĵσ-|∞|
pawn Код:
if(GetPlayerWeapon(playerid) == WEAPON_M4 && !IsPlayerAdmin(playerid))
Missing Bracket!!!!!
Код:
if(GetPlayerWeapon(playerid) == WEAPON_M4 && (!IsPlayerAdmin(playerid)))
Reply
#6

Quote:
Originally Posted by Tigerbeast11
Quote:
Originally Posted by |∞|-Рцппσĵσ-|∞|
pawn Код:
if(GetPlayerWeapon(playerid) == WEAPON_M4 && !IsPlayerAdmin(playerid))
Missing Bracket!!!!!
He's not missing anything.
Reply
#7

If hes not missing anything, then u've got an extra bracket, cuz his and urs dont match
Reply
#8

Quote:
Originally Posted by Tigerbeast11
If hes not missing anything, then u've got an extra bracket, cuz his and urs dont match
No, i don't have an extra bracket - check my and his code again and maybe you'll learn something.
Reply
#9

Don Corelli's Code
Код:
if((GetPlayerWeapon(playerid) == WEAPON_M4) && (!IsPlayerAdmin(playerid)))
|∞|-Рцппσĵσ-|∞|'s Code
Код:
if(GetPlayerWeapon(playerid) == WEAPON_M4 && !IsPlayerAdmin(playerid))
Now you tell me the difference!
Reply
#10

There's no difference - except in some extra brackets but NOT missed brackets like you thought.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)