SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/12/2012, 07:19 PM   #11
Typhome
Gangsta
 
Typhome's Avatar
 
Join Date: Mar 2009
Location: Estonia
Posts: 950
Reputation: 10
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

Code:
CMD:kick(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] > 1)
	{
		Kick(playerid);
	}
	else
	{
		SetPlayerSkin(playerid, 29);
	}
	return 1;
}
__________________
Eesti SA-MP Kommuun
Typhome is offline   Reply With Quote
Old 25/12/2012, 07:31 PM   #12
KirovArk
Little Clucker
 
Join Date: Nov 2012
Posts: 15
Reputation: 0
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

Quote:
Originally Posted by jNkk View Post
I though a kick command is to kick people... What you're trying to do ? I didn't understtand...
I am learning to script and exploring new commands
KirovArk is offline   Reply With Quote
Old 25/12/2012, 07:38 PM   #13
KirovArk
Little Clucker
 
Join Date: Nov 2012
Posts: 15
Reputation: 0
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

Quote:
Originally Posted by Tamer T View Post
CMD:kick(playerid, params[])

new id;

{
if (PlayerInfo[playerid][pAdmin]>1)
{
Kick(id);
}
else
{
SetPlayerSkin(id,29);
}
return 1;
}
Still doesn't work

It gives me skin id 29 if I'm admin but when i make myself a normal player - It doesn't kick me
KirovArk is offline   Reply With Quote
Old 25/12/2012, 07:44 PM   #14
KirovArk
Little Clucker
 
Join Date: Nov 2012
Posts: 15
Reputation: 0
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

.....

Last edited by KirovArk; 25/12/2012 at 07:45 PM. Reason: .
KirovArk is offline   Reply With Quote
Old 25/12/2012, 07:53 PM   #15
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,846
Reputation: 1399
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

The command works fine, you're doing something wrong. If your admin level is 1, it won't work because you check if the admin level is equal or greater to 2. If you want for levels 1 and greater, then you have to use '>='.
pawn Code:
CMD:kick(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin]>=1) SetPlayerSkin(playerid,29);
    else Kick(playerid);
    return 1;
}
If the operations confuse you, then read this from SA:MP Wiki - Control Structures#Operators
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 05/01/2014, 07:49 AM   #16
GokuSsj
Little Clucker
 
GokuSsj's Avatar
 
Join Date: Dec 2013
Posts: 13
Reputation: 3
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

WHAT IS THIS >.<
__________________
Pro Mapping for Free -Contact Me
GokuSsj is offline   Reply With Quote
Old 05/01/2014, 07:53 AM   #17
newbie scripter
Gangsta
 
newbie scripter's Avatar
 
Join Date: Apr 2012
Location: Heaven <3
Posts: 798
Reputation: 34
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

Quote:
Originally Posted by Typhome View Post
Code:
CMD:kick(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] > 1)
	{
		Kick(playerid);
	}
	else
	{
		SetPlayerSkin(playerid, 29);
	}
	return 1;
}
Do u know maths? '>' means greater than, it means if ur admin lvl > 1 than, u will be kicked
__________________
SUGGESTION FOR FUTURE SA-MP
pawn Code:
forward SetWeaponRange(weaponid, maxrange); // if weapon is fist and 100 range, it may give a warn or super punch xD
forward SetWeaponRecoil(weapoinid, maxrecoil);
newbie scripter is offline   Reply With Quote
Old 05/01/2014, 09:12 AM   #18
MatriXgaMer
Big Clucker
 
MatriXgaMer's Avatar
 
Join Date: Dec 2013
Location: Srbija
Posts: 169
Reputation: 5
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

pawn Code:
CMD:kick(playerid, params[])
{
      if(IsPlayerAdmin(playerid)) // I put here so the player needs to be RCON Admin to do it.
      {
          if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /kick [PlayerName/ID]");  
          Kick(targetid);
       }
       else return SendClientMessage(playerid, COLOR_RED, "Nope :3"); //Sending the person message that he isnt allowed to do that.
       return 1;
}
MatriXgaMer is offline   Reply With Quote
Old 27/04/2017, 02:03 PM   #19
KizZweLL
Little Clucker
 
KizZweLL's Avatar
 
Join Date: Jan 2016
Location: Philippines
Posts: 26
Reputation: 0
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

CMD:kick(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new RecieverID;
if(sscanf(params,"u",RecieverID)) return SendClientMessage(playerid,0xFFFFFF,"/kick [id]
if(PlayerInfo[RecieverID][pAdmin] >= 1) return SetPlayerSkin(playerid,29);
Kick(Recieverid);
}
else
{
SendClientMessage(playerid,0xFFFFFF,"You are not admin");
}
return 1;
}
KizZweLL is offline   Reply With Quote
Old 27/04/2017, 11:06 PM   #20
ShaharG
Banned
 
Join Date: Apr 2017
Posts: 14
Reputation: 5
Default Re: if (PlayerInfo[playerid][pAdmin]>1)

i didnt understand waht you are trying to do?
ShaharG is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PlayerInfo[playerid][level] omer5198 Help Archive 1 22/05/2011 04:19 PM
..::[ PlayerInfo[playerid][VozacBusa] = +0; HELP ]::.. DarkPower Help Archive 12 08/05/2010 11:31 PM
Help with if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && Keeboo13 Help Archive 0 11/04/2010 06:38 AM


All times are GMT. The time now is 11:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.