01.10.2017, 06:29
Could someone tell me whats the issue here? cause Im working on a project for someone and he gave me this gamemode to edit etc... When i do /osetrank , it sends me the error message of what i should input, so thats sign that its working. Now when i do the full command, /osetrank Amanda_Clarke Test it sends me a message say the command doesnt exist
PHP код:
COMMAND:osetrank(playerid, params[])
{
if(PlayerInfo[playerid][ranklvl] != 0) return SendClientError(playerid, CANT_USE_CMD);
if(PlayerInfo[playerid][playerteam] == CIV) return SendClientError(playerid, CANT_USE_CMD);
new iPlayer[ MAX_PLAYER_NAME ], iRank[64];
if( sscanf ( params, "ss", iPlayer, iRank) || strlen(params) > MAX_PLAYER_NAME) return SCP(playerid, "[Exact Name] [rankname]");
if(AccountExist(iPlayer) == false) return SendClientError(playerid, "Account hasn't been found!");
if(GetPlayerFaction(playerid) != GetPlayerFaction(iPlayer)) return SendClientError(playerid, "Not in the same faction!");
if(strfind(iRank, "'", true) != -1 || strfind(iRank, "=", true) != -1 || strfind(iRank, "|", true) != -1 || strlen(iRank) >= 64)
{
return SendClientError(playerid, "Invalid character(s) used (~,=,|)");
}
myStrcpy(PlayerInfo[iPlayer][rankname], iRank);
format(iStr, sizeof(iStr), "10[RANK] %s has offline set the rank of %s to %s", PlayerName(playerid), PlayerName(iPlayer), iRank);
iEcho(iStr);
format(iStr, sizeof(iStr), "# [%s] %s has offline set the rank of %s to %s.", GetPlayerFactionName(playerid), RPName(playerid), RPName(iPlayer), iRank);
SendClientMessageToTeam(PlayerInfo[iPlayer][playerteam],iStr,COLOR_PLAYER_VLIGHTBLUE);
return 1;
}