CMD:contrato(playerid,params[])
{
if(sscanf(params, "ud", giveid,grana))return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Uso correto: /Contrato [ID do Alvo] [Grana]");
if(grana > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Vocк nгo tem esse dinheiro.");
if(grana <= 500 || grana >= 10000)return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Valor entre 500 e 10000 R$");
if(!IsPlayerConnected(giveid))return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Player nгo conectado!");
Valor[giveid]+=grana;
GivePlayerMoney(playerid, -grana);
GetPlayerName(giveid, vitima, sizeof(vitima));
GetPlayerName(playerid, crioumatou, sizeof(crioumatou));
format(_Str, sizeof(_Str), "[CONTRATO] {00FF66}%s {FFFFFF}colocou um contrato de {00FF66}R$%d {FFFFFF}em %s.", crioumatou, grana, Valor[giveid], vitima);
SendClientMessageToAll(COLOR_AMARELO, _Str);
format(_Str, sizeof(_Str), "[PERIGO] %s encomendou sua morte no valor de R$%d.", crioumatou, grana);
SendClientMessage(giveid, COLOR_ERRO, _Str);
return true;
}

CMD:contrato(playerid,params[])
{
if(sscanf(params, "ud", giveid, grana)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Uso correto: /Contrato [ID do Alvo] [Grana]");
if(grana > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Vocк nгo tem esse dinheiro.");
if(grana <= 500 || grana >= 10000)return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Valor entre 500 e 10000 R$");
if(!IsPlayerConnected(giveid))return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Player nгo conectado!");
Valor[giveid]+=grana;
GivePlayerMoney(playerid, -grana);
GetPlayerName(giveid, vitima, sizeof(vitima));
GetPlayerName(playerid, crioumatou, sizeof(crioumatou));
format(_Str, sizeof(_Str), "[CONTRATO] {00FF66}%s {FFFFFF}colocou um contrato de {00FF66}R$%d {FFFFFF}em %s.", crioumatou, grana, Valor[giveid], vitima);
SendClientMessageToAll(COLOR_AMARELO, _Str);
format(_Str, sizeof(_Str), "[PERIGO] %s encomendou sua morte no valor de R$%d.", crioumatou, grana);
SendClientMessage(giveid, COLOR_ERRO, _Str);
return true;
}
CMD:vitimas(playerid)
{
new String[128];
new id;
if(Player[playerid][Fundador] <= 0) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Vocк nгo й um Assassino!");
format(String, sizeof(String), "Vitima: %s\tRecompensa: %d\tID: %d", vitima, grana, id);
ShowPlayerDialog(playerid, Dialog_Contratos, DIALOG_STYLE_LIST, "CONTRATOS", String, "Fechar", #);
return 1;
}
|
Qual a funзгo responsбvel para atribuir um contrato no jogador?
E como vocк faz pra saber quem estб com contrato? |
CMD:contrato(playerid,params[])
{
new alvoid, str[128], grana, Name[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params,"ui", alvoid, grana)) return SendClientMessage(playerid,-1,"[ x ] Uso correto: /Contrato [ Alvo ID ] [ Quantia ]");
if(GetPlayerMoney(playerid)<grana) return SendClientMessage(playerid, COLOR_ERRO,"[ x ] Vocк nгo tem essa quantia!");
if(grana < 500 || grana > 10000) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Mнnimo: 500R$ Mбximo: 15000R$");
Vitima[alvoid] = 1;
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(alvoid, Name2, sizeof(Name2));
format(str, sizeof(str),"{FFFFFF}%s[%d] {BDB76B}Colocou um contrato de {FFFFFF}%i {BDB76B}em {FFFFFF}%s[%d]", Name, playerid, grana, Name2, alvoid);
SendClientMessageToAll(COLOR_MARROMCLARO, str);
SetPVarInt(playerid, "hitmanmoney", grana);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(i==playerid)
{
cAssassino[i] = 1;
}
}
return 1;
}