Quote:
Originally Posted by Blackazur
So i have that, but i dont know, what i must make that only Admins can use it. xD
|
pawn Код:
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;
}
The player will first have to do /rcon login to use this.