class selection help again
#1

Here i make a script for class selection but the problem is when on skin id 29 its show skin 23 i mean next model
here is is pawno code
pawn Код:
new PlayerText:Textdraw0[MAX_PLAYERS];
new PlayerText:Textdraw1[MAX_PLAYERS];
new PlayerText:Textdraw2[MAX_PLAYERS];
new PlayerText:Textdraw3[MAX_PLAYERS];
new PlayerText:Textdraw4[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
    new string[126];
    format(string,sizeof(string),"skin - ~p~%d",GetPlayerSkin(playerid));
    PlayerTextDrawShow(playerid,Textdraw0[playerid]);
    PlayerTextDrawShow(playerid,Textdraw1[playerid]);
    PlayerTextDrawShow(playerid,Textdraw2[playerid]);
    PlayerTextDrawShow(playerid,Textdraw3[playerid]);
    PlayerTextDrawShow(playerid,Textdraw4[playerid]);
    PlayerTextDrawSetPreviewModel(playerid, Textdraw3[playerid],GetPlayerSkin(playerid));
    PlayerTextDrawSetString(playerid,Textdraw4[playerid],string);
    return 1;
}

public OnPlayerConnect(playerid)
{
    Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 143.875000, 117.583335, "usebox");
    PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.000000, 23.794441);
    PlayerTextDrawTextSize(playerid, Textdraw0[playerid], -2.000000, 0.000000);
    PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw0[playerid], 0);
    PlayerTextDrawUseBox(playerid, Textdraw0[playerid], true);
    PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], 0x000000FF);
    PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
    PlayerTextDrawFont(playerid, Textdraw0[playerid], 0);

    Textdraw1[playerid] = CreatePlayerTextDraw(playerid, 18.125000, 117.833366, "Spawn menu~n~   --------");
    PlayerTextDrawLetterSize(playerid, Textdraw1[playerid], 0.385623, 1.384166);
    PlayerTextDrawAlignment(playerid, Textdraw1[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw1[playerid], 16765183);
    PlayerTextDrawSetShadow(playerid, Textdraw1[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw1[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, Textdraw1[playerid], 51);
    PlayerTextDrawFont(playerid, Textdraw1[playerid], 3);
    PlayerTextDrawSetProportional(playerid, Textdraw1[playerid], 1);

    Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 3.750000, 273.583465, "Weapons:~n~~w~-Swanoff~n~~w~-UZI~n~~w~-M4~n~~w~-Clot");
    PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.411249, 1.162500);
    PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw2[playerid], 16765183);
    PlayerTextDrawSetShadow(playerid, Textdraw2[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 51);
    PlayerTextDrawFont(playerid, Textdraw2[playerid], 3);
    PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1);

    Textdraw3[playerid] = CreatePlayerTextDraw(playerid, 59.375000, 149.333404, "_");
    PlayerTextDrawFont(playerid, Textdraw3[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW);
    PlayerTextDrawUseBox(playerid,Textdraw3[playerid],true);
    PlayerTextDrawBackgroundColor(playerid, Textdraw3[playerid], 0x000000FF);
    PlayerTextDrawSetPreviewRot(playerid, Textdraw3[playerid], -10.0, 0.0, -20.0, 1.0);
    PlayerTextDrawLetterSize(playerid, Textdraw3[playerid], 0.000000, 0.000000);
    PlayerTextDrawTextSize(playerid, Textdraw3[playerid], 76.875000, 117.250030);
    PlayerTextDrawAlignment(playerid, Textdraw3[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw3[playerid], -1);
    PlayerTextDrawSetShadow(playerid, Textdraw3[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw3[playerid], 0);

    Textdraw4[playerid] = CreatePlayerTextDraw(playerid, 3.125000, 191.333389, "Skin - ~p~29");
    PlayerTextDrawLetterSize(playerid, Textdraw4[playerid], 0.298123, 1.226667);
    PlayerTextDrawAlignment(playerid, Textdraw4[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw4[playerid], 16765183);
    PlayerTextDrawSetShadow(playerid, Textdraw4[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw4[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, Textdraw4[playerid], 51);
    PlayerTextDrawFont(playerid, Textdraw4[playerid], 3);
    PlayerTextDrawSetProportional(playerid, Textdraw4[playerid], 1);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    PlayerTextDrawHide(playerid,Textdraw0[playerid]);
    PlayerTextDrawHide(playerid,Textdraw1[playerid]);
    PlayerTextDrawHide(playerid,Textdraw2[playerid]);
    PlayerTextDrawHide(playerid,Textdraw3[playerid]);
    PlayerTextDrawHide(playerid,Textdraw4[playerid]);
    return 1;
}

Reply
#2

i Think Back To Your Skin ID And Fix it
Sorry its Smail Help,
Reply
#3

how but
Reply
#4

not sure but try this -
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    new string[126];
    format(string,sizeof(string),"skin - ~p~%d",GetPlayerSkin(playerid));
    PlayerTextDrawShow(playerid,Textdraw0[playerid]);
    PlayerTextDrawShow(playerid,Textdraw1[playerid]);
    PlayerTextDrawShow(playerid,Textdraw2[playerid]);
    PlayerTextDrawShow(playerid,Textdraw4[playerid]);
    PlayerTextDrawHide(playerid, Textdraw3[playerid]);//hides first
    PlayerTextDrawSetPreviewModel(playerid, Textdraw3[playerid],GetPlayerSkin(playerid));//then sets
    PlayerTextDrawShow(playerid, Textdraw3[playerid]);//then shows
    PlayerTextDrawSetString(playerid,Textdraw4[playerid],string);
    return 1;
}
Reply
#5

thanks alot dude u r great scripter
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)