04.09.2017, 03:37
I got this rp gamemode from a friend anyways, im trying to make it so that if you get invited to a faction you got to /accept it but the /invite command works but when they do /accept faction it doesnt work
This is under the /accept faction command
The /invite command works well only the accept park doesnt work
This is under the /accept faction command
PHP код:
else if(!strcmp(params, "faction", true))
{
if(GetPVarInt(playerid, "InvitedToFaction"))
{
Invite(playerid, GetPVarInt(playerid, "InvitedToFaction"), PlayerName(playerid));
SetPVarInt(playerid, "InvitedToFaction", 0);
}
return 1;
}
PHP код:
COMMAND:invite(playerid, params[])
{
if(PlayerInfo[playerid][ranklvl] > 1) 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]);
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;
}