Help? attach object to car
#1

How i can make this work.. and work with the sabre car only?

pawn Код:
CMD:sabre(playerid,params[])
{
    #pragma unused params
    new objectid = CreateObject);
    new vehicleid = GetPlayerVehicleID(playerid);
    AttachObjectToVehicle(objectid, vehicleid, -0.159999, 1.339998, -0.124999, -135.674880, -2.010001, -90.449951);
    AttachObjectToVehicle(objectid, vehicleid, -0.150000, 1.504998, -0.124999, -135.674880, -2.010001, -90.449951);
    return 1;
}
Reply
#2

Am not use but i think you have to add something like this in your code.
Код:
if(GetVehicleModel(vehicleid) == 475
475 is the car id (sabre)
Reply
#3

Quote:
Originally Posted by TheSnaKe
Посмотреть сообщение
Am not use but i think you have to add something like this in your code.
Код:
if(GetVehicleModel(vehicleid) == 475
475 is the car id (sabre)
i get this errors
Код:
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(4994) : error 017: undefined symbol "vehicleid"
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(4995) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(4995) : error 017: undefined symbol "objectid"
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(4995 -- 4996) : error 076: syntax error in the expression, or invalid function call
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(4995 -- 4996) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#4

pawn Код:
CMD:sabre(playerid,params[])
{
    #pragma unused params
    new objectid = CreateObject(/*objectid, x, y, z,...*/);
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, 0xFF0000FF, "You must be in a vehicle to use this command.");
    if(GetVehicleModel(vehicleid) != 475) return SendClientMessage(playerid, 0xFF0000FF, "You must be in a sabre to use this command.");
    AttachObjectToVehicle(objectid, vehicleid, -0.159999, 1.339998, -0.124999, -135.674880, -2.010001, -90.449951);
    AttachObjectToVehicle(objectid, vehicleid, -0.150000, 1.504998, -0.124999, -135.674880, -2.010001, -90.449951);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)