AttachObjectToVehicle (object dosent appear) | i want to make a /stealth cmd
#1

i putted attachobjecttovehicle in a command and then when i am in a leviathan, i type /tieboard, then it dosent appear D: and when i am in a leviathan it says "You must be in a leviathan to use this command." but it should not say that D:

plz fix the code

Код:
 COMMAND:tieboard(playerid,params[])
{
   if(IsPlayerInAnyVehicle(playerid))
   {
   	  if(GetVehicleModel(417)) // THIS IS FOR LEVIATHAN (HELI)
         {
             new myobject1 = CreateObject(3117,0,0,-1000,0,0,0,100);
            AttachObjectToVehicle(myobject1, 417, -4.425000,0.524999,0.075000,0.000000,0.000000,0.000000);
            new myobject2 = CreateObject(3117,0,0,-1000,0,0,0,100);
            AttachObjectToVehicle(myobject2, 417, 4.200001,0.000000,0.000000,0.000000,0.000000,0.000000);
        }
    	else SendClientMessage(playerid, COLOR_RED, "You must be in a leviathan to use this command.");
    }
    else SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle.");
    return 1;
}
|||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||

i dont know what is the code to hide the player name

if someone types /stealth it should hide his dot on the map and his name

plz help me with /stealth.
Reply
#2

change
Код:
if(GetVehicleModel(417))
to
Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid))==417)
...also its a bad idea to store the created objects' id in a locally declared variable (myobject1 and 2). the object id will be missing - declare it global, like
Код:
new myobject1[MAX_PLAYERS];
new myobject2[MAX_PLAYERS];
in the top part of the script indeed...
the myobject1 (and 2) need the [playerid] now, to store the index of the objectid, you might need that id later

oops, i forgot to give an example:
Код:
new myobject1[playerid] = CreateObject(your stuff here);
Reply
#3

just fix the command for me and give it here plz
Reply
#4

Quote:
Originally Posted by ZayanImran
Посмотреть сообщение
just fix the command for me and give it here plz
Are you kidding me? Babul actually fixed your command.
Reply
#5

where will i put the

new myobject1[MAX_PLAYERS];
new myobject2[MAX_PLAYERS];

&

new myobject1[playerid] = CreateObject(your stuff here);
Reply
#6

I don't know but.
Is it just me or everyone?
Is the code you gave is a copy/paste?
Try to learn scripting..
Reply
#7

i am new.
Reply
#8

ohh thanks i fixed it.
Reply
#9

shit shit shit, the object do not appear -,-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)