/kick in STRCMP [+REP]
#1

Hey guys,
I am not experienced at using target ids yet so I'd like to make a /kick [id] [reason] command using STRCMP But I don't really know how to,Who ever helps me gets REP+
Reply
#2

Mind blown. Using strcmp/strtok is actually more complicated than using ZCMD and sscanf.
Reply
#3

I know but I have made all my script in STRCMP I can't change it now please.
Reply
#4

https://sampwiki.blast.hk/wiki/Creating_Commands
https://sampwiki.blast.hk/wiki/Strtok

Second link has a kick command.

REP THE WIKI!!!
Reply
#5

Quote:
Originally Posted by [SU]Spartan
Посмотреть сообщение
I know but I have made all my script in STRCMP I can't change it now please.
Yes you can
If you have +20k line code for all the basic systems without anything interesting or mappings, you are doing it wrong, each basic system wouldn't take more than 2k lines, unique or advanced systems on the other hand are a different story, and I'm 100% sure that no one would/could create an advanced systems without learning optimized ways like having sscanf or ZCMD

So yeah, stop being lazy, try to learn because best person that can help you is yourself.
Reply
#6

the callback:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{


and the code:

Код:
if(strcmp(cmdtext, "/kickme", true) == 0)
    {
        // Kicks the player who executed this command
        Kick(playerid);
        return 1;
    }
    return 0;
}


Hope i helped, Pm me if you'd like to know anything or any help.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)