forward IsAMember(playerid);
Hier die fraktions id's die den befehl nutzen können
public IsAMember(playerid)
{
if(IsPlayerConnected(playerid))
{
new leader = PlayerInfo[playerid][pLeader];
new member = PlayerInfo[playerid][pMember];
if(member==5 || member==6 || member==8 || member==11 || member==19 || member==20)
{
return 1;
}
if(leader==5 || leader==6 || leader==8 || leader==11 || leader==19 || leader==20)
{
return 1;
}
}
return 0;
}
den befehl /tie können jetzt die fraktionen 5,6,8,11,19 und 20 nutzen
if(strcmp(cmd, "/tie", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAMember(playerid) || PlayerInfo[playerid][pFMember] < 255)
{
if(PlayerInfo[playerid][pRank] < 3)
{
SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 3 oder höher! !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /tie [Name oder ID]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerTied[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Ist schon gefesselt !");
return 1;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new car = GetPlayerVehicleID(playerid);
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Du kannst dich nicht selber fesseln!"); return 1; }
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2 && IsPlayerInVehicle(giveplayerid, car))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wurdest gefesselt.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du hast %s gefesselt.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GameTextForPlayer(giveplayerid, "~r~ Gefesselt", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
PlayerTied[giveplayerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ziel ist nicht in deinem Auto oder du bist nicht der Fahrer !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Spieler ist nicht nah genug !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Player ist nicht da !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist in keiner Familie !");
}
}
return 1;
}