SA-MP Forums Archive
OnPlayerClickPlayerTextDraw - 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)
+--- Thread: OnPlayerClickPlayerTextDraw (/showthread.php?tid=495579)



OnPlayerClickPlayerTextDraw - Smacky - 17.02.2014

Okay hello everyone, I want to just make car spawning when I'll press my textdraw, I'm not telling you to write whole code for me just Car Spawning and Destroying when I'll press next button again from 400 to 500 model, Thank you very much, REP ++
Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if(playertextid == PREVIOUSBUTTON[playerid])
    {
    	return 1;
    }
    if(playertextid == NEXTBUTTON[playerid])
    {
        return 1;
    }
    return 1;
}



Re: OnPlayerClickPlayerTextDraw - Golimad - 17.02.2014

It should be something like that :
Case infernus here ID : 411

pawn Код:
new playerspawnerveh[MAX_PLAYERS];
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if(playertextid == PREVIOUSBUTTON[playerid])
    {
        New Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        playerspawnerveh[playerid] = CreateVehicle(411, Pos[0], Pos[1], Pos[2], 0, 0, 0, -1);
        SetVehicleVirtualWorld(playerspawnerveh[playerid], GetPlayerVirtualWorld(playerid));
        PutPlayerInVehicle(playerid, playerspawnerveh[playerid], 0);
       
       
        return 1;
    }
    if(playertextid == NEXTBUTTON[playerid])
    {
        DestroyVehicle(playerspawnerveh[playerid]);
        return 1;
    }
    return 1;
}
If It gives an error or something just lemme know the line where the problem might come from. Looking forwat that +rep hhaha


Re: OnPlayerClickPlayerTextDraw - Smacky - 18.02.2014

Thank you very much.