SA-MP Forums Archive
/kill doesn't work. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /kill doesn't work. (/showthread.php?tid=345382)



/kill doesn't work. - yvoms - 24.05.2012

Hello everyone,
Im busy starting my own CNR server,
But as of now, One of the most important things does not work as it should,
Whenever i type /kill it gived me the following error:
Код:
Server: Unknown Command.
But i have the command in my gamemode,
Could someone please help me out,
The gamemode is to big to put it on Pastebin so i made a .txt extension on my website,
Hope someone can help Kind regards
Yvoms - Carboncr team.
http://carboncr.org/gamemode/CNR.txt


Re: /kill doesn't work. - vIBIENNYx - 24.05.2012

pawn Код:
return 1;



Re: /kill doesn't work. - .FuneraL. - 24.05.2012

What command processor you use? strcmp or ZCMD?


Re: /kill doesn't work. - Mike_Peterson - 24.05.2012

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).


Re: /kill doesn't work. - SuperViper - 24.05.2012

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.


Re: /kill doesn't work. - yvoms - 24.05.2012

I used ur Code @mike peterson,
But anyways, If i go ingame,
and i type /kill its still saying
Код:
Server: Unknown Command.
Additional,
Can someone help me whenever i dont get something or so,
Im currently new to pawno and im about to start one big ass server,
Any help in any way will be respected and thanked greatfull.
PM me if u are able to help

Regards
yvoms -
CarbonCr owner.


Re: /kill doesn't work. - Georgi166 - 24.05.2012

Other commands work?


Re: /kill doesn't work. - Vince - 24.05.2012

Do you actually have
pawn Код:
dcmd(kill, cmdtext, 4);
in OnPlayerCommandText?

And more importantly: are you ignoring any warnings? 'Symbol is never used' in particular?


Re: /kill doesn't work. - ricardo178 - 24.05.2012

Did you actualy COMPILE the gamemode, upload it to the server and restart? Not a stupid question.. Asking for real.


Re: /kill doesn't work. - IceCube! - 24.05.2012

Quote:
Originally Posted by ricardo178
Посмотреть сообщение
Did you actualy COMPILE the gamemode, upload it to the server and restart? Not a stupid question.. Asking for real.
I've done this MENY times! - Cant go OT I couldn't e fucked to read it all .