Wie bekomme ich den Befehle /fequip hin, das man diesen nur an Fahrzeugen mit der Variable FeuerwehrVehs ausführen kann und dafür keinen /fequippunkt mehr brauche.
if(strcmp(cmd, "/fequip", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(6, playerid,253.8948,76.4892,1003.6406))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Hilfe : /equip [item nummer]");
SendClientMessage(playerid, COLOR_GREEN, "|_______ Ausrüstung _______|");
SendClientMessage(playerid, COLOR_LIGHTGREEN, "| 1: Waffen wegenehmen 2: Kettensäge");
SendClientMessage(playerid, COLOR_LIGHTGREEN, "| 3: Feuerlöscher");
SendClientMessage(playerid, COLOR_LIGHTGREEN, "| 4: Heal/Armor 5: Spray");
return 1;
}
new item = strval(tmp);
if (item == 1)
{
if(PlayerInfo[playerid][pMember] == 22||PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pLeader] == 22)
{
ResetPlayerWeapons(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
}
}
else if (item == 2)
{
if(PlayerInfo[playerid][pMember] == 22||PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pLeader] == 22)
{
GivePlayerWeapon(playerid, 9, 1);
GivePlayerMoney(playerid,-20);
FraktionsKasse[6] += 20;
SendClientMessage(playerid,0xAA3333AA,"Du hast 20$ für die Kettensäge bezahlt");
GetPlayerName(playerid, sendername, sizeof(sendername));
}
}
else if (item == 3)
{
if(PlayerInfo[playerid][pMember] == 22||PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pLeader] == 22) {
GivePlayerWeapons(playerid,42,99999);
GivePlayerMoney(playerid,-100);
FraktionsKasse[6] += 100;
SendClientMessage(playerid,0xAA3333AA,"Du hast 100$ für den Feuerlöscher bezahlt");
GetPlayerName(playerid, sendername, sizeof(sendername));
}
}
else if (item == 4)
{
if(PlayerInfo[playerid][pMember] == 22||PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pLeader] == 22)
{
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid,0xAA3333AA,"Du hast dich geheilt");
GetPlayerName(playerid, sendername, sizeof(sendername));
}
}
else if (item == 5)
{
if(PlayerInfo[playerid][pMember] == 22||PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pLeader] == 22)
{
GivePlayerWeapons(playerid,42,9999);//Deagle
}
}
}
return 1;
}
}
//Edit PWN nochmal neu eingefügt
//Edit Fehler /equip in /fequip geändert