Medic problem
#1

Hi all i am using this medic command,but when a medic can health him self all the time and do spamm score to him self,how i can make this command to dont work on him self id?

PHP код:
COMMAND:heal(playerid,params[])
{
    new 
pId;
    new 
pskin GetPlayerSkin(playerid);
    if(
pskin == 275 || pskin == 276 || pskin == 274)
    
    {
        if(
sscanf(params"d"pId)) return SendClientMessage(playerid0xFF0000AA"Usage: /heal [ID]");
            else if(!
IsPlayerConnected(pId)) return SendClientMessage(playerid0xFF0000AA"The ID You Entered Was Not Found.");
                else
                {
                    new 
Float:xFloat:yFloat:z;
                    
GetPlayerPos(pIdxyz);
                    if(
IsPlayerInRangeOfPoint(playerid5.0xyz))
                    {
                        new 
pname[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME], string1[250], string2[256], string3[100], string4[100];
                        
GetPlayerName(playeridpnamesizeof(pname));
                        
GetPlayerName(pIdanamesizeof(aname));
                        new 
Float:Health;
                        
GetPlayerHealth(pIdHealth);
                        if(
Health == 0)
                        {
                            
SendClientMessage(playerid0xFF0000AA"This player is very healthy!");
                            return 
1;
                        }
                        else
                        
GetPlayerHealth(pIdHealth);
                        if(
Health 100)
                        {
                            
GivePlayerMoney(playerid,200);
                            
                            
GivePlayerMoney(pId,-200);
                            
SetPlayerHealth(pId100);
                           
                            
format(string1sizeof(string1), "%s(%d) Has been healthed by medic %s(%d)"anamepIdpnameplayerid);
                            
SendClientMessageToAll(0xFF0000AAstring1);
                            
format(string2sizeof(string2), "You are full of health now!");
                            
SendClientMessage(pId0xFF0000AAstring2);
                            
SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
                            
format(string3sizeof(string3), "You have received 1 score for health an injured player!");
                            
SendClientMessage(playerid0xFF0000AAstring3);
                            return 
1;
                        }
                    }
                }
               }
               else
               {
                   return 
SendClientMessage(playerid0xFF0000AA"Error: You are not medic or you can heal people every 15 sec!!");
            }
    return 
1;

help..
Reply


Messages In This Thread
Medic problem - by jimis - 16.07.2012, 08:40
Re: Medic problem - by jimis - 16.07.2012, 08:55
Re: Medic problem - by [MM]RoXoR[FS] - 16.07.2012, 09:11
Re: Medic problem - by jimis - 16.07.2012, 09:18

Forum Jump:


Users browsing this thread: 1 Guest(s)