Need help with teleporting system
#1

pawn Код:
COMMAND:tp(playerid, params[])
{
    new tele;
    if(sscanf(params, "f", tele)) SendClientMessage(playerid, RED, "USAGE: /tp id (use /teles for ID list).");
    else
    {
    if(tele == 1)
    {
        SetPlayerPos(playerid, 0, 0, 0);
     }
    if(tele == 2)
    {
        SetPlayerPos(playerid, 0, 0, 0);
    }
        }
    return 1;
}
I doesn't work. When I type /tp 1 nothing happens.
(if you think it doesn't do anything because of the cords, it's not because of that. Even if I change it to SendClientMessage nothing shows up.)
Reply
#2

I tried switch and it didn't work either. The problem is probably in the sscanf line. Any help? Never used sscanf before because I find it confusing.
Reply
#3

Fixed. I didn't know what did the second parameter for sscanf did. lol.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)