CMD:laseron(playerid, params[])
{
//the code is here blah blah
return 1;
}
CMD:laseron(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
// The code is here blah blah
}
return 1;
}
CMD:laseron(playerid, params[])
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][AdminLevel] >= 1) // If the player is RCON admin or lvl 1 + Admin
{
// The code is here blah blah
}
return 1;
}
CMD:laseron(playerid, params[]) { SetPVarInt(playerid, "laser", 1); SetPVarInt(playerid, "color", GetPVarInt(playerid, "color")); return 1; } CMD:laseroff(playerid, params[]) { SetPVarInt(playerid, "laser", 0); RemovePlayerAttachedObject(playerid, 0); return 1; } CMD:lasercol(playerid, params[]) { new color[16]; if(sscanf(params, "s[15]", color)) return SendClientMessage(playerid, C_GREY, "USAGE: /lasercol [color]"); if(!strcmp(color, "red", true)) SetPVarInt(playerid, "color", 18643); else if(!strcmp(color, "blue", true)) SetPVarInt(playerid, "color", 19080); else if(!strcmp(color, "pink", true)) SetPVarInt(playerid, "color", 19081); else if(!strcmp(color, "orange", true)) SetPVarInt(playerid, "color", 19082); else if(!strcmp(color, "green", true)) SetPVarInt(playerid, "color", 19083); else if(!strcmp(color, "yellow", true)) SetPVarInt(playerid, "color", 19084); else SendClientMessage(playerid, C_VIOLET, "Color not available!"); return 1; } |
So i have that, but i dont know, what i must make that only Admins can use it. xD
|
CMD:laseron(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
SetPVarInt(playerid, "laser", 1);
SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));
}
SendClientMessage(playerid,C_VIOLET,"You are not an admin");
return 1;
}
CMD:laseroff(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
SetPVarInt(playerid, "laser", 0);
RemovePlayerAttachedObject(playerid, 0);
}
SendClientMessage(playerid,C_VIOLET,"You are not an admin");
return 1;
}
CMD:lasercol(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new color[16];
if(sscanf(params, "s[15]", color)) return SendClientMessage(playerid, C_GREY, "USAGE: /lasercol [color]");
if(!strcmp(color, "red", true)) SetPVarInt(playerid, "color", 18643);
else if(!strcmp(color, "blue", true)) SetPVarInt(playerid, "color", 19080);
else if(!strcmp(color, "pink", true)) SetPVarInt(playerid, "color", 19081);
else if(!strcmp(color, "orange", true)) SetPVarInt(playerid, "color", 19082);
else if(!strcmp(color, "green", true)) SetPVarInt(playerid, "color", 19083);
else if(!strcmp(color, "yellow", true)) SetPVarInt(playerid, "color", 19084);
else SendClientMessage(playerid, C_VIOLET, "Color not available!");
}
SendClientMessage(playerid,C_VIOLET,"You are not an admin");
return 1;
}