GetObjectModel help
#8

PHP код:
AttachAble(objectmodel)
{
    switch(
objectmodel)
    {
        case 
19601,19843,19796: return 1;
    }
    return 
0;
}
CMD:attachobject(playerid, params[])
{
    new 
objectmodel, car;
    if(
sscanf(params, "ii", objectmodel, car))
    {
        
SendServerMessage(playerid, "Use: /attachobject [object model] [SAMP Car ID]");
        return 
1;
    }
    if(!
AttachAble(objectmodel))
        return 
SendErrorMessage(playerid, "Invaild objectid use /attachableids");
     if(
0 < car < MAX_VEHICLES)
     {
          new 
Float:px, Float:py, Float:pz;
          
GetPlayerPos(playerid, px, py, pz);
          
AttachingObjects[playerid] = CreateObject(objectmodel, px, py, pz, 0.0, 0.0, 0.0);
          
SendClientMessage(playerid, 0xfce80cFF, "Object created. Editing...");
          
EditObject(playerid, AttachingObjects[playerid]);
          
SetPVarInt(playerid, "AttachingTo", car);
    }
    else
    {
        
SendErrorMessage(playerid, "Invalid vehicle");
    }
    return 
1;
} 
You should use object model in every where not getting object model id, cause you're not attaching object on your car, you creating new one, so
Код:
GetObjectModel(objectid)
were unless

about the stock
https://sampforum.blast.hk/showthread.php?tid=570635
Reply


Messages In This Thread
GetObjectModel help - by N0FeaR - 31.03.2016, 14:01
Re: GetObjectModel help - by N0FeaR - 01.04.2016, 09:18
Re: GetObjectModel help - by Konstantinos - 01.04.2016, 09:37
Re: GetObjectModel help - by Antoniohl - 01.04.2016, 09:38
Re: GetObjectModel help - by N0FeaR - 01.04.2016, 10:08
Re: GetObjectModel help - by BroZeus - 01.04.2016, 10:15
Re: GetObjectModel help - by N0FeaR - 01.04.2016, 11:17
Re: GetObjectModel help - by jlalt - 01.04.2016, 11:26
Re: GetObjectModel help - by N0FeaR - 01.04.2016, 11:48

Forum Jump:


Users browsing this thread: 1 Guest(s)