help needed with /kill <id>
#1

how can i make a /kill <id> command so i typed ingame /kill 1 that the player with id 1 is killed,
srry for my bad english im dutch ^^

thnx for helping,
speediekiller2
Reply
#2

It's with strcmp ?
Reply
#3

... ^ That's not the proper question. Do you use strtok or sscanf?
Reply
#4

i use sscanf and strcmp
Reply
#5

Quote:
Originally Posted by speediekiller2
Посмотреть сообщение
i use sscanf and strcmp
I'm surprised
Reply
#6

alright but how can i make it?
Reply
#7

pawn Код:
if(!strcmp(cmdtext,"/kill"))
{
    new ID;
    if(sscanf(cmdtext, "u", ID)) return SendClientMessage(playerid, -1, "/kill[playerid]");

    SetPlayerHealth(ID,0);
    return true;
}
Reply
#8

There are no 'params' when using strcmp under OnPlayerCommandText. Use a command processor.
Reply
#9

Params equal cmdtext.
pawn Код:
if(!strcmp(cmdtext,"/kill"))
{
    new ID;
    if(sscanf(cmdtext, "u", ID)) return SendClientMessage(playerid, -1, "/kill[playerid]");

    SetPlayerHealth(ID,0);
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)