Getcar problem
#1

My /getcar doesnt work. No errors on compile

pawn Код:
CMD:getcar(playerid, params[])
{
    new carid;
    if(PlayerInfo[playerid][pAdminLevel] >= 3)
    {
        if(sscanf(params, "i", carid)) return SendClientMessage(playerid, ~1, "USAGE: /getcar [carid]");
        if(carid > MAX_VEHICLES) return SendClientMessage(playerid, ~1, "That  vehicle does not exists.");
        new Float: gPos[3];
        GetPlayerPos(playerid, gPos[0], gPos[1], gPos[2]);
        SetVehiclePos(carid, gPos[0] + 2, gPos[1], gPos[2]);
    }
    return 1;
}
Reply
#2

Try this:
pawn Код:
CMD:getcar(playerid,params[])
{
    //admin check
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, -1, "Usage: /vget [VehicleID]") &&
        SendClientMessage(playerid,-1, "Function: Will Bring the specified Vehicle to your Position");
        new player1;
        new string[128];
        player1 = strval(params);
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid,x,y,z);
        SetVehiclePos(player1,x+3,y,z);
        SetVehicleVirtualWorld(player1,GetPlayerVirtualWorld(playerid));
        format(string,sizeof(string),"You brought the Vehicle ID '%d' to your Position", player1);
        return SendClientMessage(playerid,-1,string);
    }
    //else return                  //you can tell em its not a player command
}
Reply
#3

Yeah but that's without sscanf.
Reply
#4

Try this, it may seem the same, i just tested it myself. It works fine for me:

pawn Код:
CMD:getcar(playerid, params[])
{
    new carid;
    if(sscanf(params, "i", carid)) return SendClientMessage(playerid, ~1, "USAGE: /getcar [carid]");
    if(carid > MAX_VEHICLES) return SendClientMessage(playerid, ~1, "That  vehicle does not exists.");
    new Float: gPos[3];
    GetPlayerPos(playerid, gPos[0], gPos[1], gPos[2]);
    SetVehiclePos(carid, gPos[0] + 2, gPos[1], gPos[2]);
    return 1;
}
Reply
#5

Try this:

pawn Код:
CMD:getcar(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 3)
    {
        new carid;
        if(sscanf(params, "d", carid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /getcar [carid]");
        new Float:plocx,Float:plocy,Float:plocz;

        GetPlayerPos(playerid, plocx, plocy, plocz);
        SetVehiclePos(carid,plocx,plocy+4, plocz);
        SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
        LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
    }
    return 1;
}
+REP if I helped!, I hope that I helped ya
Reply
#6

Ty VM +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)