/kill doesn't work.
#1

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
Reply
#2

pawn Код:
return 1;
Reply
#3

What command processor you use? strcmp or ZCMD?
Reply
#4

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).
Reply
#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
#6

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.
Reply
#7

Other commands work?
Reply
#8

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?
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)