#6

Quote:
Originally Posted by Speed
Посмотреть сообщение
i have problem with /goto

pawn Код:
CMD:goto(playerid, params[])
{
    new id, car;
    if(sscanf(params, "u", id))return Use(playerid, "/goto [name/ID]");
    else if(PlayerInfo[playerid][pAdmin] < 1)return SendAdmin(playerid, "Not admin!");
    new Float:x, Float:y, Float:z;
    GetPlayerPos(id, x, y, z);
    SetPlayerPos(playerid, x+1, y, z);
    if(IsPlayerInVehicle(playerid, car))
    {
        SetVehiclePos(car, x, y, z);
        PutPlayerInVehicle(playerid, car, 0);
    }
    SendClientMessage(playerid, Grey, "Teleport.");
    return 1;
}
i can port with car, pls help.. how to port with a car to person?
Car is not assigned a value yet, so it's 0.. therefore it won't work. However you can save time and effort by simply adding IsPlayerInAnyVehicle function.

pawn Код:
CMD:goto(playerid, params[])
{
    new id;
    if(sscanf(params, "u", id))return Use(playerid, "/goto [name/ID]");
    else if(PlayerInfo[playerid][pAdmin] < 1)return SendAdmin(playerid, "Not admin!");
    new Float:x, Float:y, Float:z;
    GetPlayerPos(id, x, y, z);
    SetPlayerPos(playerid, x+1, y, z);
     if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
        PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
    }
    SendClientMessage(playerid, Grey, "Teleport.");
    return 1;
}
Reply


Messages In This Thread
goto - by Speed - 17.11.2011, 21:24
Re: goto - by Kingunit - 17.11.2011, 21:33
Re: goto - by Speed - 17.11.2011, 21:34
Re: goto - by Kingunit - 17.11.2011, 21:35
Re: goto - by Speed - 17.11.2011, 21:37
Respuesta: goto - by admantis - 17.11.2011, 21:39
Re: goto - by Kingunit - 17.11.2011, 21:40
AW: goto - by Babul - 17.11.2011, 21:43

Forum Jump:


Users browsing this thread: 1 Guest(s)