#4

Here, try this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new idx;
    cmd = strtok(idx,cmdtext);
    if(strcmp(cmd,"/teleports",true)==0)
    {
        SendClientMessage(playerid, COLOR_INDIGO, "----- Teleports ----------------------------------------------------------");
        SendClientMessage(playerid, COLOR_WHITE, "StuntZones :: /SF /AA /LV /Chilliad /SFair /LSair /LVair /LVdrift /SFdrift /beach /disney");
        SendClientMessage(playerid, COLOR_SILVER, "Jumps :: /SFjump /hugejump /glassjump /bikejump /waterjump /tunneljump /pipejump /qjump /bigjump /skiramp");
        SendClientMessage(playerid, COLOR_GOLD, "Races :: /racemap /karttrack");
        SendClientMessage(playerid, COLOR_PINK, "CRAZY :: /xslide /loop /drop /gd /lf /tugfun /SKC /tr /pipe /carsumo /hp /slide");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "SmallZones :: /monster /boats /bowl /NRGbowl /bc /ball");
        SendClientMessage(playerid, COLOR_GREEN, "Skillz :: /bikeskills /bmx /bikefun /wallride /skatepark /monsterchallenge");
        SendClientMessage(playerid, COLOR_GREY, "Misc :: /wang /otto /hippy /truckstop /LSdive /grotto /andro");
        SendClientMessage(playerid, COLOR_FIREBRICK, "DMs :: /battlefield /rocket /war /tankdm");
        SendClientMessage(playerid, COLOR_WHITE, "Tune: /loco /arch /trans /ps");
        SendClientMessage(playerid, COLOR_INDIGO, "--------------------------------------------------------------------------");
        return 1;
    }
    if(strcmp(cmd,"/quadparkour",true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            RemovePlayerFromVehicle(playerid);
        }
        SetPlayerPos(playerid,-2904.806, 880.312, 5.354);
        TeleMSG(playerid, "Quadparkour (/quadparkour)");
        return 1;
    }
    if(strcmp(cmd,"/racetrack",true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid),9490.785, -862.395, 7.970);
        }
        SetPlayerPos(playerid,9487.672, -839.953, 7.970);
        TeleMSG(playerid, "Racetrack (/racetrack)");
        return 1;
    }
    if(strcmp(cmd,"/xslide",true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            RemovePlayerFromVehicle(playerid);
        }
        SetPlayerPos(playerid,1862.760, 1337.315, 55.933);
        TeleMSG(playerid, "XSlide (/xslide)");
        return 1;
    }
    if(strcmp(cmd,"/lounge",true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] == 0)
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to use this command!");
            return 1;
        }
        else
        {
            SetPlayerPos(playerid, 445.5988, -6.7742, 1000.7344);
            SetPlayerInterior(playerid, 1);
            SendClientMessage(playerid, COLOR_GREENYELLOW, "Welcome to the admin lounge!");
        }
        return 1;
    }
    if(strcmp(cmd,"/grotto",true) == 0)
    {
        SetPlayerPos(playerid,-980.7980, 963.5360, 34.5781);
        TeleMSG(playerid, "SaS Grotto (/grotto)");
        return 1;
    }
    if(strcmp(cmd,"/spiral",true) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, COLOR_GREENYELLOW, "Get a vehicle from /otto or /wang first or spawn one using /carspawn!");
            return 1;
        }
        SetVehiclePos(GetPlayerVehicleID(playerid),24.8275, 278.3997, 1199.8948);
        TeleMSG(playerid, "Spiral (/spiral)");
        SetPVarInt(playerid, "doingStunt", 4);
        return 1;
    }
    if(strcmp(cmd,"/andro",true) == 0)
    {
        SetPlayerPos(playerid,-2184.5669, 1171.0330, 1700.4305);
        GivePlayerWeapon(playerid, 46, 1);
        TeleMSG(playerid, "Andro (/andro)");
        return 1;
    }
    if(strcmp(cmd,"/skiramp",true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid),-1331.3870,-1661.8210,538.1722);
        }
        else
        {
            SetPlayerPos(playerid,-1331.3870,-1661.8210,538.1722);
        }
        TeleMSG(playerid, "SKIRamp (/skiramp)");
        return 1;
    }
    if(strcmp(cmd,"/drifts",true) == 0)
    {
        SendClientMessage(playerid, COLOR_PINK, "DRIFTS:");
        SendClientMessage(playerid, COLOR_GOLD, " -> /lvdrift, /sfdrift");
        return 1;
    }
    if(strcmp(cmd,"/sfdrift",true) == 0)
    {
        SetPlayerPos(playerid, -2410.9963, -600.7848, 132.3277);
        TeleMSG(playerid, "SFDrift (/sfdrift)");
        return 1;
    }
    if(strcmp(cmd,"/lvdrift",true) == 0)
    {
        SetPlayerPos(playerid, -344.308, 1528.474, 75.159);
        TeleMSG(playerid, "LVDrift (/lvdrift)");
        return 1;
    }
    if(strcmp(cmd,"/lsdive",true) == 0)
    {
        SetPlayerPos(playerid, 1544.5403, -1348.7823, 329.4739);
        TeleMSG(playerid, "LSDive (/lsdive)");
        GivePlayerWeapon(playerid, 46, 1);
        return 1;
    }
    if(strcmp(cmd,"/skatepark",true) == 0)
    {
        new tele;
        tele = random(2);
        switch(tele)
        {
            case 0: SetPlayerPos(playerid, 1907.542, -1354.829, 13.103);
            case 1: SetPlayerPos(playerid, 1917.501, -1404.901, 13.179);
        }
        TeleMSG(playerid, "/skatepark");
        return 1;
    }
    if(strcmp(cmd,"/lvair",true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            RemovePlayerFromVehicle(playerid);
        }
        SetPlayerPos(playerid, 1302.729, 1297.582, 13.055);
        TeleMSG(playerid, "/lvair");
        return 1;
    }
    return 1;
}

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
I haven't done all the teleports, but you get the idea... Remember to remove the COMMAND: one's too.
Reply


Messages In This Thread
Why wont my teles work :L - by WillyP - 25.07.2010, 15:03
Re: ... - by Shadow™ - 25.07.2010, 15:28
Re: ... - by WillyP - 25.07.2010, 19:05
Re: ... - by Shadow™ - 25.07.2010, 20:04
Re: ... - by WillyP - 25.07.2010, 20:24
Re: ... - by Shadow™ - 27.07.2010, 18:05
Re: ... - by WillyP - 29.07.2010, 20:29

Forum Jump:


Users browsing this thread: 1 Guest(s)