12.11.2014, 17:46
HEre its the command that i invite members to a faction
Quote:
COMMAND:invite(playerid, params[]) { if(PlayerInfo[playerid][ranklvl] == 2 && PlayerInfo[playerid][authority_invite] != 1) return SendClientError(playerid, CANT_USE_CMD); if(PlayerInfo[playerid][ranklvl] > 2) return SendClientError(playerid, CANT_USE_CMD); if(PlayerInfo[playerid][playerteam] == CIV) return SendClientError(playerid, CANT_USE_CMD); new iPlayer; if( sscanf ( params, "u", iPlayer)) return SCP(playerid, "[PlayerID/PartOfName]"); if(!IsPlayerConnected(iPlayer) || iPlayer == playerid) return SendClientError(playerid, PLAYER_NOT_FOUND); if(GetPlayerFaction(iPlayer) != CIV) return SendClientError(playerid, "Player is not a civilian!"); if(PlayerInfo[iPlayer][playerlvl] < 1 && PlayerInfo[playerid][playerteam] != COPS) return SendClientError(playerid, "The player is level 1."); SetPVarInt(iPlayer, "InvitedToFaction", PlayerInfo[playerid][playerteam]); SetPVarInt(iPlayer, "InvitedBy", playerid); format(iStr, sizeof(iStr), "%s has invited you to join %s. Use ~r~/accept faction~w~ to join %s.", RPName(playerid), PlayerInfo[playerid][PTeamName],PlayerInfo[playerid][PTeamName]); ShowInfoBox(iPlayer, "Faction Invite", iStr); return 1; } |