SA-MP Forums Archive
help needed with /kill <id> - 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: help needed with /kill <id> (/showthread.php?tid=339717)



help needed with /kill <id> - speediekiller2 - 04.05.2012

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


Re: help needed with /kill <id> - ViniBorn - 04.05.2012

It's with strcmp ?


Re: help needed with /kill <id> - sleepysnowflake - 04.05.2012

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


Re: help needed with /kill <id> - speediekiller2 - 04.05.2012

i use sscanf and strcmp


Re: help needed with /kill <id> - ViniBorn - 04.05.2012

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


Re: help needed with /kill <id> - speediekiller2 - 04.05.2012

alright but how can i make it?


Re: help needed with /kill <id> - ViniBorn - 04.05.2012

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

    SetPlayerHealth(ID,0);
    return true;
}



Re: help needed with /kill <id> - MP2 - 04.05.2012

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


Re: help needed with /kill <id> - zSuYaNw - 04.05.2012

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;
}