[AJUDA]MEDICO
#8

Pronto. Ta ae.

Nгo usei o seu codigo pois daria mais trabalho, entгo criei os meus proprios comandos:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext,"/sCurar",true) == 0)
    {
        new 
pIDgranaFloat:VidaFloat:XYZ[3], n[MAX_PLAYER_NAME], n2[MAX_PLAYER_NAME], str[128];
        
tmp strtok(cmdtextidx);
        
pID strval(tmp);
        if(!
strlen(tmp)) return SendClientMessage(playerid, -1,"USO: /sCurar [ID] [PRECO]");
        
tmp strtok(cmdtextidx);
        
grana strval(tmp);
        if(!
strlen(tmp)) return SendClientMessage(playerid, -1,"USO: /sCurar [ID] [PRECO]");
        
GetPlayerHealth(pIDVida);
        if(
Vida >= 100) return SendClientMessage(playerid, -1,"O jogador jб estб com a vida completa.");
        if(
GetPVarInt(playerid,"Curando") == 1)) return SendClientMessage(playerid, -1,"Vocк jб estб curando alguem.");
        if(
GetPVarInt(pID,"Curando") == 1)) return SendClientMessage(playerid, -1,"O jogador jб estб sendo curado.");
        
GetPlayerPos(pIDXYZ[0], XYZ[1], XYZ[2]);
        
GetPlayerName(pIDn2sizeof(n2));
        
GetPlayerName(playeridnsizeof(n));
        if(!
IsPlayerInRangeOfPoint(playerid5XYZ[0], XYZ[1], XYZ[2]) return SendClientMessage(playerid, -1"Vocк nгo estб proximo ao jogador.");
        
format(strsizeof(str),"O jogador %s te ofereceu cura por %d dolбres. Para aceitar digite /aceitarcura."ngrana);
        
SendClientMessage(pID,-1,str);
        
format(strsizeof(str),"Vocк ofereceu cura para o jogador %s por %d dolбres. Aguarde atй que ele aceite."n2grana);
        
SendClientMessage(playerid,-1,str);
        
SetPVarInt(playerid,"Curando"1);
        
SetPVarInt(pID,"Curando"1);
        
SetPVarInt(pID,"User",playerid);
        
SetPVarInt(pID,"Valor",grana);
        return 
1;
    }
    if(
strcmp(cmdtext,"/aceitarcura",true) == 0)
    {
        new 
n[MAX_PLAYER_NAME], n2[MAX_PLAYER_NAME], str[128];
        if(
GetPVarInt(playerid,"Curando") == 0) return SendClientMessage(playerid, -1,"Ninguйm te ofereceu cura.");
        
GetPlayerName(GetPVarInt(playerid,"User"), nsizeof(n));
        
GetPlayerName(playeridn2sizeof(n2));
        
format(strsizeof(str),"Vocк foi curado por %s no valor de %d dolбres."nGetPVarInt(playerid,"Valor"));
        
SendClientMessage(playerid, -1str);
        
format(strsizeof(str),"Vocк curou %s por %d dolбres."n2GetPVarInt(playerid,"Valor"));
        
SendClientMessage(playerid, -1str);
        
GivePlayerMoney(playerid, -GetPVarInt(playerid,"Valor"));
        
GivePlayerMoney(GetPVarInt(playerid,"User"), GetPVarInt(playerid,"Valor"));
        
SetPlayerHealth(playerid,100.0);
        
SetPVarInt(GetPVarInt(playerid"User"), "Curando"0);
        
SetPVarInt(playerid"Curando"0);
        
DeletePVar(playerid,"Valor");
        
DeletePVar(playerid,"User");
        return 
1;
    }
    return 
0;

#EDIT Testou ??
Reply


Messages In This Thread
[AJUDA]MEDICO - by viniciusstreet - 25.05.2011, 08:26
Re: [AJUDA]MEDICO - by Chefгo - 25.05.2011, 08:37
Re: [AJUDA]MEDICO - by viniciusstreet - 28.05.2011, 08:38
Re: [AJUDA]MEDICO - by Shadoww5 - 28.05.2011, 15:52
Re: [AJUDA]MEDICO - by viniciusstreet - 29.05.2011, 05:18
Re: [AJUDA]MEDICO - by viniciusstreet - 01.06.2011, 04:33
Re: [AJUDA]MEDICO - by Shadoww5 - 01.06.2011, 16:51
Re: [AJUDA]MEDICO - by Shadoww5 - 01.06.2011, 17:03
Re: [AJUDA]MEDICO - by Andrew_Guiga - 03.06.2011, 21:40
Re: [AJUDA]MEDICO - by Shadoww5 - 03.06.2011, 22:44

Forum Jump:


Users browsing this thread: 1 Guest(s)