SA-MP Forums Archive
[HELP] Attach/Detach Stairs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Attach/Detach Stairs (/showthread.php?tid=202810)



[HELP] Attach/Detach Stairs - <Weponz> - 25.12.2010

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!



Re: [HELP] Attach/Detach Stairs - Haydz - 25.12.2010

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;
}



Re: [HELP] Attach/Detach Stairs - Sascha - 25.12.2010

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;
}



Re: [HELP] Attach/Detach Stairs - <Weponz> - 25.12.2010

Thanks guys