Problem, function doesn't work. -
Scriptissue - 07.10.2010
Whosoever knows how to solve it please comment.
I was working on a /goto command, but seems like it doesn't work, when I type it just send me that I'm not authorized to use that command, even though I'm admin, and logged on RCON feature.
Script:
pawn Код:
if(strcmp(cmd, "/setarmor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1){return SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setarmor [playerid/PartOfName] [armor]");
}
new pID;
new otherId;
new GivenName[MAX_PLAYER_NAME];
new armouramount;
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* Invalid ID!");
{
GetPlayerName(pID, GivenName, sizeof(GivenName));
format(string, sizeof(string), "* You have successfully given armour to %s Armour range: %d",GivenName, armouramount);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
new Float:armour;
GetPlayerArmour(otherId, armour);
{
SetPlayerArmour(otherId, armouramount);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You have been given armour by Admin %s Armour range: :%d ", sendername, armouramount);
SendClientMessage(otherId, 0xFF4646FF, string);
}
}
return 1;
}
Re: Problem, function doesn't work. -
NoobScripter1 - 07.10.2010
pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 1){return SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");}
This aint rcon thats your own variables for admin sytem did you create a cmd to makeadmin levels?
Re: Problem, function doesn't work. -
NoobScripter1 - 07.10.2010
Or you can put this
pawn Код:
if(!ADMINLINE) return SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
Thas for rcon hope it help you
Re: Problem, function doesn't work. -
Scriptissue - 07.10.2010
No more messages, It just doesn't show anything, no even the result of the command, it just shows the I gave armor to a certain user, but It doesn't show the increase of the armor, plus when I type the command it automatically send me two messages, and it doesn't show the range of the armor, it just says "0"
pawn Код:
if(strcmp(cmd, "/setarmor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setarmor [playerid/PartOfName] [armor]");
}
new pID;
new otherId;
new GivenName[MAX_PLAYER_NAME];
new armouramount;
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* Invalid ID!");
{
GetPlayerName(pID, GivenName, sizeof(GivenName));
format(string, sizeof(string), "* You have successfully given armour to %s Armour range: %d",GivenName, armouramount);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
new Float:armour;
GetPlayerArmour(otherId, armour);
{
SetPlayerArmour(otherId, armouramount);
}
GetPlayerName(playerid, sendername, sizeof(sendername)); // This is for admin name
format(string, sizeof(string), "* You have been given armour by Admin %s Armour range: :%d ", sendername, armouramount);
SendClientMessage(otherId, 0xFF4646FF, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
return 1;
}