[HELP] Attach/Detach Stairs
#1

Im having trouble with my "OnStairsAttachToBaggade" callback i want it so when "Trailer ID" 608 (Airport Stairs) attaches to the baggade it sends the a GameText,Its just not working

Any Help

pawn Код:
forward OnStairsAttachToBaggade(playerid,vehicleid);
public OnStairsAttachToBaggade(playerid,vehicleid)
{
    if(GetVehicleTrailer(IsTrailerAttachedToVehicle(608)))
    {
    GameTextForPlayer(playerid,"\n\n\n\n\n~w~Stairs ~g~Attached!",3000,5);
    }
    return 1;
}
And my /detach just aint working either :S

pawn Код:
CMD:detach(playerid, params[])
{
    if(!IsPlayerInVehicle(playerid, 485))
    {
        SendClientMessage(playerid,RED,"You Need To Be In A Baggade To Attach/Detach Stairs!");
    }
    if(GetVehicleTrailer(IsTrailerAttachedToVehicle(806)))
    {
    new stairs;
    stairs = IsTrailerAttachedToVehicle(608);
    DetachTrailerFromVehicle(stairs);
    GameTextForPlayer(playerid,"\n\n\n\n\n~w~Stairs ~g~Detached!",3000,5);
    }
    else
    {
        SendClientMessage(playerid,RED,"There Are No Stairs Attached!");
    }
    return true;
}
Any help?

Thanks In Advanced!
Reply
#2

Not sure about the stairs attaching sorry.
This is what i used on my server.
Код:
command(detach, playerid, params[])
{
    new var0 = 0;
    var0 = GetPlayerVehicleID(playerid);
    DetachTrailerFromVehicle(var0);
    SendClientMessage(playerid, color, "detach message);
    return 1;
}
Reply
#3

hehe well you mixed up an ID:
if(GetVehicleTrailer(IsTrailerAttachedToVehicle(80 6)))

you should use 608 if I'm right:P

EDIT: lol I didn't read it right... this should work:
Код:
CMD:detach(playerid, params[])
{
    if(!IsPlayerInVehicle(playerid, 485))
    {
        SendClientMessage(playerid,RED,"You Need To Be In A Baggade To Attach/Detach Stairs!");
    }
    new vid = GetVehicleTrailer(GetPlayerVehicleID(playerid));
    if(GetVehicleModel(vid) == 608)
    {
    DetachTrailerFromVehicle(vid);
    GameTextForPlayer(playerid,"\n\n\n\n\n~w~Stairs ~g~Detached!",3000,5);
    }
    else
    {
        SendClientMessage(playerid,RED,"There Are No Stairs Attached!");
    }
    return true;
}
Reply
#4

Thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)