if(strcmp(cmd, "/contract", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "* Not Logged In");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /contract [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /contract [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if(moneys < 10000 || moneys > 100000) { SendClientMessage(playerid, COLOR_WHITE, "* Contract money must be atleast $10000, and not more then $100000!"); return 1; }
/* if(PlayerInfo[playerid][pLevel] < 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You must be level 3 to place a Contract.");
return 1;
}*/
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pMember] == 8 && PlayerInfo[playerid][pMember] ==
{
SendClientMessage(playerid, COLOR_WHITE, "* Cannot place Contracts on your own Agency!");
return 1;
}
else if(PlayerInfo[giveplayerid][pLeader] == 8 && PlayerInfo[playerid][pMember] ==
{
SendClientMessage(playerid, COLOR_WHITE, "* Cannot place Contracts on your own Agency!");
return 1;
}
else if(PlayerInfo[giveplayerid][pMember] == 8||PlayerInfo[giveplayerid][pLeader] ==
{
SendClientMessage(playerid, COLOR_WHITE, "* Can't contract a Hitman !");
return 1;
}
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_WHITE, "You cannot Contract yourself!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playerpcash = PlayerInfo[playerid][pCash];
if (moneys > 0 && playerpcash >= moneys)
{
ServerGivePlayerMoney(playerid, (0 - moneys));
PlayerInfo[giveplayerid][pHeadValue]+=moneys;
format(string, sizeof(string), "%s has placed a contract on %s, for $%d.",sendername, giveplayer, moneys);
SendFamilyMessage(8, COLOR_YELLOW, string);
format(string, sizeof(string), "* You placed a contract on %s, for $%d.",giveplayer, moneys);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1;
}
return 1;
}
|