What's wrong? /kill command
#1

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

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

Reply
#3

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

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;
}
Reply
#5

Nevermind read below
Reply
#6

Use GameTextForPlayer instead of TextDrawCreate
Reply
#7

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

I want it to look exactly like offline mode
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)