command problem with id 0
#6

Ok, check this out:
PHP код:
if(strcmp(cmd"/fishslap"true) == 0)
{
    
tmp strtok(cmdtextidx);
    new 
targetid strval(tmp);
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1"[ERROR]: That player is not connected !");
    
    if(
gTeam[playerid] == CIVILIAN || gTeam[playerid] == GAZA)
    {
        if(
playerid != targetid)
        {
            if(
GetDistanceBetweenPlayers(playeridtargetid) <= 4)
            {
                if(
IsPlayerSpawned(playerid))
                {
                    if(
IsPlayerSpawned(targetid))
                    {
                        if(!
IsPlayerInAnyVehicle(playerid))
                        {
                            if(!
IsPlayerInAnyVehicle(targetid))
                            {
                                new 
ID;
                                new 
Float:health;
                                new 
FloatFloat:yFloat:zstring[100];
                                if(
GetPVarInt(playerid,"CMDABUSE1")>GetTickCount() ) return SendClientMessage(playerid,0xFF0000AA,"Please Wait Before Fish Slapping Someone Again.");
                                
SetPVarInt(playerid,"CMDABUSE1",GetTickCount()+600 00);
                                
GetPlayerPos(IDxyz);
                                
SetPlayerPos(IDxyz+1.5);
                                
GetPlayerHealth(ID,health);
                                
SetPlayerHealth(IDhealth-5);
                                
PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
                                
PlayerPlaySound(ID,1190,0.0,0.0,0.0);
                                
format(string100"You have Used Fishslap"nameID);
                                
SendClientMessage(playeridCOLOR_YELLOWstring);
                                
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel (playerid)+ 1);
                                return 
true;
                            }
                            else
                            {
                                new 
errormsg[250];
                                new 
blown[MAX_PLAYER_NAME];
                                
GetPlayerName(targetidblownsizeof(blown));
                                
format(errormsgsizeof(errormsg), "%s[ID:%d] is in a Vehicle. You cannot fishslap the person inside a vehicle."blowntargetid);
                                
SendClientMessage(playeridERRORerrormsg);
                                return 
true;
                            }
                        }
                        else return 
SendClientMessage(playeridERROR"You cannot fishslap anyone from inside a vehicle.");
                    }
                    else
                    {
                        new 
errormsg[250];
                        new 
blown[MAX_PLAYER_NAME];
                        
GetPlayerName(targetidblownsizeof(blown));
                        
format(errormsgsizeof(errormsg), "%s[ID:%d] is dead."blowntargetid);
                        
SendClientMessage(playeridERRORerrormsg);
                        return 
true;
                    }
                }
                else return 
SendClientMessage(playerid,0xFF0000AA,"Cannot Fishslap When Your Dead.");
            }
            else return 
SendClientMessage(playerid,0xFF0000AA,"Nobody Is Close Enough To Fishslap.");
        }
        else return 
SendClientMessage(playerid,0xFF0000AA,"You Cannot Slap YourSelf!");
    }
    else return 
SendClientMessage(playerid,0xFF0000AA,"Only Civilians Can Fishslap People.");

Reply


Messages In This Thread
command problem with id 0 - by MWhite_005 - 23.07.2011, 19:43
Re: command problem with id 0 - by Kush - 23.07.2011, 19:45
Re: command problem with id 0 - by sansko - 23.07.2011, 19:46
Re: command problem with id 0 - by MWhite_005 - 23.07.2011, 19:50
Re: command problem with id 0 - by MWhite_005 - 23.07.2011, 19:52
Re: command problem with id 0 - by MoroDan - 23.07.2011, 19:59
Re: command problem with id 0 - by MWhite_005 - 23.07.2011, 20:07
Re: command problem with id 0 - by MWhite_005 - 23.07.2011, 20:30
Re: command problem with id 0 - by MWhite_005 - 23.07.2011, 20:33
Re: command problem with id 0 - by MoroDan - 23.07.2011, 20:36

Forum Jump:


Users browsing this thread: 1 Guest(s)