SA-MP Forums Archive
What's wrong? /kill command - 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: What's wrong? /kill command (/showthread.php?tid=453200)



What's wrong? /kill command - JEkvall95 - 24.07.2013

When I use /kill my server says it is a uknown command

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    TextDrawCreate(190.0, 190.0, "WASTED");
    if (strcmp("/kill", cmdtext, true, 5) == 0)
    {
        SetPlayerHealth(playerid, 0.0);
        return 1;
    }
    return 0;
}



Re: What's wrong? /kill command - ThePhenix - 24.07.2013

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    
TextDrawCreate(190.0190.0"WASTED");
    if(!
strcmp(cmdtext"/kill"true))
    {
        
SetPlayerHealth(playerid0.0);
        return 
1;
    }
    return 
0;




Re: What's wrong? /kill command - JEkvall95 - 24.07.2013

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    
TextDrawCreate(190.0190.0"WASTED");
    if(!
strcmp(cmdtext"/kill"true))
    {
        
SetPlayerHealth(playerid0.0);
        return 
1;
    }
    return 
0;

Still says unknown command


Re: What's wrong? /kill command - Tayab - 24.07.2013

EDIT: Try below
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/kill", cmdtext, true, 5) == 0)
    {
		SetPlayerHealth(playerid,0);
                TextDrawCreate(190.0, 190.0, "WASTED");
		return 1;
    }
    return 0;
}



Re: What's wrong? /kill command - JimmyCh - 24.07.2013

Nevermind read below


Re: What's wrong? /kill command - Scottas - 24.07.2013

Use GameTextForPlayer instead of TextDrawCreate


Re: What's wrong? /kill command - JEkvall95 - 25.07.2013

Quote:
Originally Posted by Scottas
Посмотреть сообщение
Use GameTextForPlayer instead of TextDrawCreate
Why?

I want it to look exactly like offline mode


Re: What's wrong? /kill command - Threshold - 25.07.2013

This is not the correct way to use TextDrawCreate.

Read here: https://sampwiki.blast.hk/wiki/TextDrawCreate

There are related functions listed in the link I've given that will help you successfully create this. It can sometimes be a lengthy and time consuming process, so you might want to try giving 'TextDraw' editors or creators a go.