if (PlayerInfo[playerid][pAdmin]>1) -
KirovArk - 25.12.2012
Quote:
CMD:kick(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin]>1)
{
Kick(playerid);
}
else
{
SetPlayerSkin(playerid,29);
}
return 1;
}
//////////////////////////////////
CMDetadmin(playerid, params[])
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Admin",1);
INI_Close(File);
return 1;
}
CMDetplayer(playerid, params[])
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Admin",0);
INI_Close(File);
return 1;
}
|
I want to make /kick command and if player is an admin,it sets his skin to 29 and if player is not an admin then it kicks him. - Someone please help me
Re: if (PlayerInfo[playerid][pAdmin]>1) -
kristo - 25.12.2012
if (PlayerInfo[playerid][pAdmin]>1)
Change > to <
Respuesta: if (PlayerInfo[playerid][pAdmin]>1) -
Strier - 25.12.2012
< = - Level 1, > = + Level 1, wich means > 1 = Can kick the player, < 1 cannot kick him.
Re: if (PlayerInfo[playerid][pAdmin]>1) -
Konstantinos - 25.12.2012
pawn Code:
CMD:kick(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin]>1) SetPlayerSkin(playerid,29);
else Kick(playerid);
return 1;
}
Re: if (PlayerInfo[playerid][pAdmin]>1) -
KirovArk - 25.12.2012
Thanks guys,Appreciate
Re: if (PlayerInfo[playerid][pAdmin]>1) -
KirovArk - 25.12.2012
It's NOT working
It kicks me even if i'm admin.
Re: if (PlayerInfo[playerid][pAdmin]>1) -
KirovArk - 25.12.2012
Quote:
CMD:kick(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin]>1)
{
SetPlayerSkin(playerid,29);
}
else
{
SetPlayerSkin(playerid,31);
}
return 1;
}
|
I tried with that but it freezes my player and I cant move at all...
Someone please help and write what >, < , += ,-=... means.
Re: if (PlayerInfo[playerid][pAdmin]>1) -
KirovArk - 25.12.2012
Quote:
if (PlayerInfo[playerid][pAdmin]>=1)
{
SetPlayerSkin(playerid,29);
}
|
That worked but it only changed my skin to 29 but
Quote:
else
{
SetPlayerSkin(playerid,31);
}
return 1;
}
|
didn't work.
Re: if (PlayerInfo[playerid][pAdmin]>1) -
jNkk - 25.12.2012
I though a kick command is to kick people... What you're trying to do ? I didn't understtand...
Re: if (PlayerInfo[playerid][pAdmin]>1) -
Tamer - 25.12.2012
CMD:kick(playerid, params[])
new id;
{
if (PlayerInfo[playerid][pAdmin]>1)
{
Kick(id);
}
else
{
SetPlayerSkin(id,29);
}
return 1;
}
Re: if (PlayerInfo[playerid][pAdmin]>1) -
Typhome - 25.12.2012
Code:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 1)
{
Kick(playerid);
}
else
{
SetPlayerSkin(playerid, 29);
}
return 1;
}
Re: if (PlayerInfo[playerid][pAdmin]>1) -
KirovArk - 25.12.2012
Quote:
Originally Posted by jNkk
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
Re: if (PlayerInfo[playerid][pAdmin]>1) -
KirovArk - 25.12.2012
Quote:
Originally Posted by Tamer T
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
Re: if (PlayerInfo[playerid][pAdmin]>1) -
KirovArk - 25.12.2012
.....
Re: if (PlayerInfo[playerid][pAdmin]>1) -
Konstantinos - 25.12.2012
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
Re: if (PlayerInfo[playerid][pAdmin]>1) -
GokuSsj - 05.01.2014
WHAT IS THIS >.<
Re: if (PlayerInfo[playerid][pAdmin]>1) -
newbie scripter - 05.01.2014
Quote:
Originally Posted by Typhome
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
Re: if (PlayerInfo[playerid][pAdmin]>1) -
MatriXgaMer - 05.01.2014
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;
}
Re: if (PlayerInfo[playerid][pAdmin]>1) -
KizZweLL - 27.04.2017
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;
}
Re: if (PlayerInfo[playerid][pAdmin]>1) -
ShaharG - 27.04.2017
i didnt understand waht you are trying to do?