SA-MP Forums Archive
[AJUDA] Comando /curar !!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Comando /curar !!! (/showthread.php?tid=300717)



[AJUDA] Comando /curar !!! - danktog - 01.12.2011

Olб galera, estou criando um comando de criar mais estou com um problema... o o mйdico poem /curar, tem que por /Curar [id player] [Preзo]... ai o player tem que /aceitar ou /recusar, mais quando o player aceitar nгo sei como por pra diminuir o dinheiro do player e aumentar o dinheiro do mйdico... vo postar o cуdigo abaixo...

Quote:

if(strcmp(cmd,"/curar", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(pAdmin[playerid] == 4 || dini_Int(file, "Profissao") == Paramedico || IsPlayerAdmin(playerid)){
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, COLOR_RED, "Use: /curar [id] [preзo]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_RED, "Use: /curar [id] [preзo]");
return 1;
}
skin = strval(tmp);
if(IsPlayerConnected(plid)){
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "O Paramйdico %s estб querendo te curar por R$%d", aname, skin);
SendClientMessage(plid, Azul, string);
format(string, sizeof(string), "Vocк enviou o convite de curativo a %s, pelo preзo de R$%d", pname, skin);
SendClientMessage(playerid, Azul, string);
convitevida[plid] = 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Jogador nгo conectado.");
return 1;
}
}
}

Код:
if(strcmp(cmd, "/aceitar", true) == 0)
{
new plid;
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(IsPlayerConnected(playerid))
{
if(convitevida[plid] == 1){
SendClientMessage(plid,Amarelo, "Vocк aceitou o curativo!");
format(string, sizeof(string), "O Player %s(ID: %d) aceitou o curativo.", aname, plid);
SendClientMessage(playerid, Amarelo, string);
SetPlayerHealth(plid, 100);
GivePlayerMoney(plid, -???);
GivePlayerMoney(playerid, ???);
convitevida[plid] = 0;
}
}
return 1;
}
Код:
if(strcmp(cmd, "/recusar", true) == 0)
{
new plid;
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(IsPlayerConnected(playerid))
{
if(convitevida[plid] == 1){
SendClientMessage(plid,Amarelo, "Vocк recusou o curativo!");
format(string, sizeof(string), "O Player %s(ID: %d) recusou o curativo.", aname, playerid);
SendClientMessage(playerid, Amarelo, string);
convitevida[plid] = 0;
}
}
return 1;
}
Alguem por favor, pode ajudar


Re: [AJUDA] Comando /curar !!! - dPlaYer_ - 01.12.2011

pawn Код:
if(strcmp(cmd, "/aceitar", true) == 0)
{
new plid;
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(IsPlayerConnected(playerid))
{
if(convitevida[plid] == 1){
SendClientMessage(plid,Amarelo, "Vocк aceitou o curativo!");
format(string, sizeof(string), "O Player %s(ID: %d) aceitou o curativo.", aname, plid);
SendClientMessage(playerid, Amarelo, string);
SetPlayerHealth(playerid, 100);
GivePlayerMoney(plid, 200);
GivePlayerMoney(playerid, -100);
convitevida[plid] = 0;
}
}
return 1;
}



Re: [AJUDA] Comando /curar !!! - |_MeGaTroN_| - 01.12.2011

pawn Код:
//Coloque como variavel global
new plid, skin;

if(strcmp(cmd, "/aceitar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    skin = strval(tmp);
    if(IsPlayerConnected(playerid)) {
        if(convitevida[plid] == 1) {
            SendClientMessage(plid,Amarelo, "Vocк aceitou o curativo!");
            format(string, sizeof(string), "O Player %s(ID: %d) aceitou o curativo.", aname, plid);
            SendClientMessage(playerid, Amarelo, string);
            SetPlayerHealth(playerid, 100);
            GivePlayerMoney(plid, skin);
            GivePlayerMoney(playerid, -skin);
            convitevida[plid] = 0;
        }
    }
    return 1;
}



Re: [AJUDA] Comando /curar !!! - dPlaYer_ - 01.12.2011

Quote:
Originally Posted by |_MeGaTroN_|
Посмотреть сообщение
pawn Код:
//Coloque como variavel global
new plid, skin;

if(strcmp(cmd, "/aceitar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    skin = strval(tmp);
    if(IsPlayerConnected(playerid)) {
        if(convitevida[plid] == 1) {
            SendClientMessage(plid,Amarelo, "Vocк aceitou o curativo!");
            format(string, sizeof(string), "O Player %s(ID: %d) aceitou o curativo.", aname, plid);
            SendClientMessage(playerid, Amarelo, string);
            SetPlayerHealth(playerid, 100);
            GivePlayerMoney(plid, skin);
            GivePlayerMoney(playerid, -skin);
            convitevida[plid] = 0;
        }
    }
    return 1;
}
o gm dele й o da TC [ The Crims ]
esse negocio de plid,skin e o cod n foi ele q fez, ele sу fez uma base. varios comandos sгo assim, q tem isso
ja mandei o cmd pronto


Re: [AJUDA] Comando /curar !!! - danktog - 01.12.2011

[LF]PlaYer isso vai diminuir um certo dinheiro do player, estou querendo que diminui o preзo que ele por no /curar... vo testar esse do |_MeGaTroN_|


Re: [AJUDA] Comando /curar !!! - dPlaYer_ - 01.12.2011

entгo testa o do megatron


Re: [AJUDA] Comando /curar !!! - Cristhian - 01.12.2011

o do megatron estб correto!


Re: [AJUDA] Comando /curar !!! - Dreppins_Coodaaw - 01.02.2012

O Comando /curar tambйm pode ser assim : [ acho ]

pawn Код:
CMD:curar(playerid,params[])
{
    GivePlayerMoney(playerid, -500); //tirou 500reais ao player.    
    SetPlayerHealth(playerid, 100); //dб 100% de vida ao player.    
    SetPlayerArmor(playerid, 100); //Dб 100% de colete ao player    
    return 1;    
}



Re: [AJUDA] Comando /curar !!! - dPlaYer_ - 01.02.2012

Quote:
Originally Posted by Dreppins_Coodaaw
Посмотреть сообщение
O Comando /curar tambйm pode ser assim : [ acho ]

pawn Код:
CMD:curar(playerid,params[])
{
    GivePlayerMoney(playerid, -500); //tirou 500reais ao player.    
    SetPlayerHealth(playerid, 100); //dб 100% de vida ao player.    
    SetPlayerArmor(playerid, 100); //Dб 100% de colete ao player    
    return 1;    
}



Re: [AJUDA] Comando /curar !!! - Lucas_Alemao - 01.02.2012

kkkkkkkkkkkkkkkkkkkkk player й comedia