їComo realizo esto?
#9

Quote:
Originally Posted by OTACON
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Objeto", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid)) //Tu Error = no abres la llave
            if(!IsValidObject(Objeto[playerid]))
            {
              new
                Float:x,
                Float:y,
                Float:z,
                Float:a;
                GetPlayerPos(GetPlayerFacingAngle(playerid), x, y, z); //Tu Error = GetPlayerFacingAngle(playerid) = playerid
                GetPlayerFacingAngle(GetPlayerVehicleID(playerid), a); //Tu Error = GetPlayerVehicleID(playerid) = playerid
                GetXYInfrontOfPlayer(playerid, x, y, 10.0); //Tu Error = GetXYInfrontOfPlayer = GetXYInFrontOfPlayer (Fron esta sin mayuscula la inicial)
                Objeto[playerid] = CreateObject(1655, x, y, z, 0.0, 0.0, a);
            }
        }
        } // //Tu Error = una llave de mas
        return 1;
    }
    if (strcmp("/Quitarobjeto", cmdtext, true, 10) == 0)
    {
        if(IsValidObject(Objeto[playerid])) //Tu Error = no abres la llave
             DestroyObject(Objeto[playerid]);
        }
        return 1;
    }
    return 0;
}
pawn Код:
#include <a_samp>
new Objeto[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[]) {
    if (strcmp("/Objeto", cmdtext, true, 10) == 0) {
        if(IsPlayerInAnyVehicle(playerid)) {
            if(!IsValidObject(Objeto[playerid])) {
                new Float:pos[4];
                GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                GetPlayerFacingAngle(playerid, pos[3]);
                GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 10.0);
                Objeto[playerid] = CreateObject(1655, pos[0], pos[1], pos[2], 0.0, 0.0, pos[3]);
            }
        }
    }
    if (strcmp("/Quitarobjeto", cmdtext, true, 10) == 0) {
         if(IsValidObject(Objeto[playerid])) {
             DestroyObject(Objeto[playerid]);
         }
    }
    return 0;
}
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) {
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
ЎUh!

que tonto Mucha gracias
Reply


Messages In This Thread
їComo realizo esto? - by JaimitoxD - 10.06.2013, 00:18
Respuesta: їComo realizo esto? - by JustBored - 10.06.2013, 00:27
Re: їComo realizo esto? - by JaimitoxD - 10.06.2013, 01:20
Respuesta: їComo realizo esto? - by JustBored - 10.06.2013, 01:24
Re: їComo realizo esto? - by JaimitoxD - 10.06.2013, 01:43
Respuesta: їComo realizo esto? - by EduGTA - 10.06.2013, 01:47
Re: Respuesta: їComo realizo esto? - by JaimitoxD - 10.06.2013, 01:54
Respuesta: їComo realizo esto? - by OTACON - 10.06.2013, 11:37
Respuesta: їComo realizo esto? - by JaimitoxD - 10.06.2013, 12:15

Forum Jump:


Users browsing this thread: 1 Guest(s)