/kill doesn't work.
#5

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
This is the code hes talking about
pawn Код:
dcmd_kill(playerid,params[])
{
    #pragma unused params
    if(IsCuffed[playerid] == 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot kill yourself while handcuffed. How could that be possible?");
        return 1;
    }
    if(IsKidnapped[playerid] == 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
        return 1;
    }
    if(IsSpawned[playerid] == 0)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You are already dead, why on earth would you want to kill yourself twice?");
        return 1;
    }
    if(GetPlayerWantedLevel(playerid) >= 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot use /kill to kill yourself while you have a wanted level.");
        return 1;
    }
    if(JailTime[playerid] >= 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot use /kill to kill yourself while you are in jail.");
        return 1;
    }
    HasUsedKill[playerid] =1;
    SetPlayerHealth(playerid,0);
    return 1;
}
Isn't this more compact?

pawn Код:
dcmd_kill(playerid,params[])
{
    #pragma unused params
    if(IsCuffed[playerid] == 1) return SendClientMessage(playerid,COLOR_ERROR,"You cannot kill yourself while handcuffed. How could that be possible?");
    if(IsKidnapped[playerid] == 1) return SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
    if(IsSpawned[playerid] == 0) return SendClientMessage(playerid,COLOR_ERROR,"You are already dead, why on earth would you want to kill yourself twice?");
    if(GetPlayerWantedLevel(playerid) >= 1) return SendClientMessage(playerid,COLOR_ERROR,"You cannot use /kill to kill yourself while you have a wanted level.");
    if(JailTime[playerid] >= 1) return SendClientMessage(playerid,COLOR_ERROR,"You cannot use /kill to kill yourself while you are in jail.");
    HasUsedKill[playerid] = 1;
    SetPlayerHealth(playerid,0.0);
    return 1;
}
Btw, just keep using dcmd no matter what people say, I use it too, works great for me. only when you're having difficulties, switch to zcmd(no me gusta).
ZCMD is faster for commands with parameters.
Reply


Messages In This Thread
/kill doesn't work. - by yvoms - 24.05.2012, 20:12
Re: /kill doesn't work. - by vIBIENNYx - 24.05.2012, 20:15
Re: /kill doesn't work. - by .FuneraL. - 24.05.2012, 20:16
Re: /kill doesn't work. - by Mike_Peterson - 24.05.2012, 20:27
Re: /kill doesn't work. - by SuperViper - 24.05.2012, 20:40
Re: /kill doesn't work. - by yvoms - 24.05.2012, 21:27
Re: /kill doesn't work. - by Georgi166 - 24.05.2012, 21:43
Re: /kill doesn't work. - by Vince - 24.05.2012, 22:11
Re: /kill doesn't work. - by ricardo178 - 24.05.2012, 22:38
Re: /kill doesn't work. - by IceCube! - 24.05.2012, 22:42

Forum Jump:


Users browsing this thread: 3 Guest(s)