[Tutorial] Creating a simple tp/kill command.
#1

Creating simple /tp and /kill commands.

Many newbies scripters want to start making a stunt server for example. They will need some basics commands. Im here to help them. Im ModianO, a regular scripter by my opinion and i will help you creating /tp and /kill command.

What can /tp and /kill commands can help you with:
Those two commands[/tp /kill] plays big roles in stunt servers usually. You can use /kill if you are stuck and use /tp t go to another stunt place, spawn location and more places that you can script.

What /tp and /kill are not useful for:

If you have an DM/RP server /tp and /kill is not needed. Reason is, when you are in DM and you are about to kill someone he does /tp or /kill in order to dont give you a better score. In RP servers /tp cmd and /kill are only useful if you are admin. Since /tp and /kill are non-rp cmds.


1. Open SA:MP and enter in a server.
2. Go to a position that you want to teleport and do /save tp-place.[tp-place is a comment]
3. Open Documents--->Gta sa user files----> SAMP---->saved positions.txt.
4. Copy[CTRL+C]the position you saved.[the format is AddPlayerClass(playerid, skinid,FLOATX,FLOATY,FLOATZ,facingangle); You will copy the floatx,y,z);
5. Open your server's folder then click to the folder "pawno" and open pawno.exe.
6. Press CTRL+F and search for public OnPlayerCommandText(playerid, cmdtext[]).
7. Copy paste this one:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd,"/tp", true) == 0)
    {
        SetPlayerPos(playerid, FLOATX,FLOATY,FLOATZ);
        return 1;
    }
    if(strcmp(cmd,"/kill",true) == 0)
    {
        SetPlayerHealth(playerid, 0);
        return 1;
    }
    return 0;
}
Note: I don't want to prove anyone "noob" or "professional" scripter. I earn all the information needed about scripting and sharing it with others.

If you think this tutorial was not helpful let me know in comments.
Reply
#2

It looks kind of hard for me to follow and I'm a experienced scripter, worrys me thinking that newbies wont even be able to read it.

I suggest using [ pawn][ /pawn] without spaces.
Reply
#3

Drop it like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

    if(strcmp(cmd,"/tp", true) == 0)
    {
        SetPlayerPos(playerid, FLOATX,FLOATY,FLOATZ);
        return 1;
    }
    if(strcmp(cmd,"/kill",true) == 0)
    {
        SetPlayerHealth(playerid, 0);
        return 1;
    }
    return 0;
}
And explain what you are doing.
Reply
#4

Sorry for this but whoever gave me rep saying this:
Код:
NOTICE: Yeah, your REALLY experienced, uh huh, especially with that Vortex edit of yours, dumb ass.
I didn't intentionally mean "experienced" I just meant I kind of know what I'm doing so really. Also was there any need for "dumb ass"?

And thanks for the rep!
Reply
#5

Quote:
Originally Posted by -Luis
Посмотреть сообщение
Sorry for this but whoever gave me rep saying this:
Код:
NOTICE: Yeah, your REALLY experienced, uh huh, especially with that Vortex edit of yours, dumb ass.
I didn't intentionally mean "experienced" I just meant I kind of know what I'm doing so really. Also was there any need for "dumb ass"?

And thanks for the rep!
http://en.wikipedia.org/wiki/Experience

Btw, this is tutorial for you to create tutorial:
https://sampforum.blast.hk/showthread.php?tid=65567
Reply
#6

Thank you very very much for your help . Im trying to be as much helpful as i can, with your help i will be even more .
Reply
#7

Good. First try? You are good I wasn't scripting for 10 months maybe. I forgot to script :S That's why I make bad tutorials.
Reply
#8

Good! Keeeppp itt da up?
Reply
#9

Thnx )
Reply
#10

hah the simple cmds tutorial i ever see
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)