Simple Teleport Command [For Beginners]
#1

Hey All!
Here i Will Show You How To Make A Simple Teleport Command!
First Of All: You Will Need Some Experience On "SetPlayerPos"

This Will Go On "OnPlayerCommandText"
pawn Code:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, //PUT HERE THE PLAYER POSITION);
        SendClientMessage (playerid, //COLOR , "//MESSAGE");
        return 1;
    }


    }
    return 0;
}
Adding More Things To It
Example, Sending Money "GivePlayerMoney(playerid,
//AMMOUNT)"

pawn Code:
if (strcmp("/grove", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
        SendClientMessage(playerid, COLOR_RED , "Hey");
         GivePlayerMoney(playerid,500);
        return 1;
    }


    }
    return 0;
}
Adding Some Guns
Get Guns Id From
https://sampwiki.blast.hk/wiki/Weapons "GivePlayerWeapon(playerid, 31, 9999);"

pawn Code:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
        SendClientMessage(playerid, COLOR_RED , "Hey");
         GivePlayerWeapon(playerid, 31, 9999); //31 IS THE M4, 9999 IS AMMO
        return 1;
    }


    }
    return 0;
}
Setting Player Health And Armour "SetPlayerHealth(playerid, 100)" "SetPlayerArmour(playerid, 100);"

pawn Code:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, //PLAYER POSITION);
        SendClientMessage(playerid, //COLOR , "//MESSAGE");
         SetPlayerHealth(playerid, 100); //100 IS THE PLAYER HEALTH CHANGE IT IF U WANT
        SetPlayerArmour(playerid, 100); //100 IS THE PLAYER ARMOUR CHANGE IT IF U WANT
       
        return 1;
    }


    }
    return 0;
}
Full Teleport Command

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/shoot", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, 1457.7526,-1062.9589,213.3828);
        SendClientMessage(playerid, COLOR_RED , "Ready To Shoot!");
        GivePlayerWeapon(playerid, 31, 9999);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        return 1;
    }

    }
    return 0;
}
Please Reply If It Was HelpFul!
Reply
#2

Well i think people knew how to make a teleport.
But the tutorial is a good one never the less.
Good work, now try making a tut for a more complex thing.

/Artix
Reply
#3

Quote:
Originally Posted by [RiFA
Artix ]
Well i think people knew how to make a teleport.
But the tutorial is a good one never the less.
Good work, now try making a tut for a more complex thing.

/Artix
I agree that people know how to make a Simple Teleport command but still there are many who done even know 'P' of pawno ... No Offence... So this tutorial may be really helpful to them
Reply
#4

Quote:
Originally Posted by ►►►Peter Corneile◄◄◄
Quote:
Originally Posted by [RiFA
Artix ]
Well i think people knew how to make a teleport.
But the tutorial is a good one never the less.
Good work, now try making a tut for a more complex thing.

/Artix
I agree that people know how to make a Simple Teleport command but still there are many who done even know 'P' of pawno ... No Offence... So this tutorial may be really helpful to them
Those should really need to learn the basics, not read tutorials like this.

To comment on the tutorial, at least give it a correct indentation. If you show someone how to do something, do it correctly.
Reply
#5

i did this because alot of people still don't know how to make tele commands like newbies!
but i will do alot of more things to help people
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)