Hi leute,
da mein altes ja gelöscht wurde, hier nochmal...
Weiß leider nicht wieso und von wem aber egal...
Also, wenn man /contract macht, wird einem das geld NICHT abgezogen
sondern das geld wird dem abgezogen, der dann getötet wurde,sprich dem,
der den contract drauf hatte
hier der contract befehl etc...
if(strcmp(cmd, "/contract", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if(moneys < 5000 || moneys > 100000) { SendClientMessage(playerid, COLOR_GREY, " Nicht weniger als $5000 oder mehr als $100000!"); return 1; }
if(PlayerInfo[playerid][pLevel] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Du musst lvl 1Sein.");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pMember] == 8 && PlayerInfo[playerid][pMember] == 8)
{
SendClientMessage(playerid, COLOR_GREY, " Cannot place Contracts on your own Agency!");
return 1;
}
else if(PlayerInfo[giveplayerid][pLeader] == 8 && PlayerInfo[playerid][pMember] == 8)
{
SendClientMessage(playerid, COLOR_GREY, " Cannot place Contracts on your own Agency!");
return 1;
}
else if(PlayerInfo[giveplayerid][pMember] == 8||PlayerInfo[giveplayerid][pLeader] == 8)
{
SendClientMessage(playerid, COLOR_GREY, " Can't contract a Hitman !");
return 1;
}
if(gTeam[giveplayerid] == 2 && moneys != 20000)
{
SendClientMessage(playerid, COLOR_GREY, " Bei Cops mindestens 20000$ Aufträge!");
return 1;
}
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Contract yourself!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys)
{
GivePlayerMoney(playerid, (- moneys));
PlayerInfo[giveplayerid][pHeadValue]+=moneys;
format(string, sizeof(string), "%s hat ein Kopfgeld auf %s ausgesetzt, Lohn $%d.",sendername, giveplayer, moneys);
SendFamilyMessage(8, COLOR_YELLOW, string);
format(string, sizeof(string), "* Du hast ein kopfgeld auf %s ausgesetzt, Lohn $%d.",giveplayer, moneys);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
return 1;
}
hier wenn er auftrag erledigt hat...
if(PlayerInfo[playerid][pHeadValue] > 0)
{
if(IsPlayerConnected(killerid))
{
if(gTeam[killerid] == 1 || PlayerInfo[killerid][pLeader] == 8)
{
if(GoChase[killerid] == playerid)
{
ConsumingMoney[killerid] = 1;
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
GivePlayerPCash(killerid, PlayerInfo[playerid][pHeadValue]);
format(string,128,"<< Hitman %s hat den Vertrag mit %s vervollständigt und %d$ gesammelt. >>",killer,name,PlayerInfo[playerid][pHeadValue]);
SendFamilyMessage(8, COLOR_YELLOW, string);
PlayerInfo[playerid][pHeadValue] = 0;
GotHit[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
}
}
}
}