Textdraw CJ skin
#1

I making something about gun, and its show me CJ skin, not the gun..

Код:
PlayerTextDrawSetPreviewModel(playerid, Weapon26[playerid], GetPlayerWeapon(playerid));
Reply
#2

Код:
PlayerTextDrawShow(playerid, Weapon26[playerid]);
You need to show textdraws again to update the changes.
Reply
#3

Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
Код:
PlayerTextDrawShow(playerid, Weapon26[playerid]);
You need to show textdraws again to update the changes.
Yes i do that, but nothing, again CJ skin
Reply
#4

Well then GetPlayerWeapon is returning 0 (player isn't holding any weapon)...


By the way you can't use it as this way, it returns the weapon id not the weapon model, so you need to put it on your code:


Код:
GetModelFromWeapon(weapon)
{
switch(weapon) {
case 0: return 19475;//invisible model case 1: return 331; case 2: return 333; case 3: return 334; case 4: return 335; case 5: return 336; case 6: return 337; case 7: return 338; case 8: return 339; case 9: return 341; case 10: return 321; case 11: return 322; case 12: return 323; case 13: return 324; case 14: return 325; case 15: return 326; case 16: return 342; case 17: return 343; case 18: return 344; case 22: return 346; case 23: return 347; case 24: return 348; case 25: return 349; case 26: return 350; case 27: return 351; case 28: return 352; case 29: return 353; case 30: return 355; case 31: return 356; case 32: return 372; case 33: return 357; case 34: return 358; case 35: return 359; case 36: return 360; case 37: return 361; case 38: return 362; case 39: return 363; case 40: return 364; case 41: return 365; case 42: return 366; case 43: return 367; case 44: return 368; case 45: return 369; case 46: return 371;
} return 0;
}
And wherever you want to use it:
Код:
PlayerTextDrawSetPreviewModel(playerid, Weapon26[playerid], GetModelFromWeapon(GetPlayerWeapon(playerid)));
PlayerTextDrawShow(playerid, Weapon26[playerid]);
Reply
#5

Not work, again CJ skin..
I don't understand what is the problem..
I try also using timers ho check if player have model 1 than set
Код:
PlayerTextDrawSetPreviewModel(playerid, Weapon26[playerid], 331);
and its work, but its updating every time when timer start,and flashing..

But it doesn't show CJ skin in that way..

I also try using stock..


PHP код:
stock GetObjectModel(playerid)
{
    new
        
_ObjectModel 0;
    switch( 
GetPlayerWeaponplayerid ) )
    {
        case 
1_ObjectModel 331;
        case 
2_ObjectModel 333;
        case 
3_ObjectModel 334
        case 
4_ObjectModel 335;
        case 
5_ObjectModel 336;
        case 
6_ObjectModel 337;
        case 
7_ObjectModel 338;
        case 
8_ObjectModel 339;
        case 
9_ObjectModel 341;
        case 
10_ObjectModel 321;
        case 
11_ObjectModel 322;
        case 
12_ObjectModel 323;
        case 
13_ObjectModel 324;
        case 
14_ObjectModel 325;
        case 
15_ObjectModel 326;
        case 
16_ObjectModel 342;
        case 
17_ObjectModel 343;
        case 
18_ObjectModel 344;
        case 
22_ObjectModel 346;
        case 
23_ObjectModel 347;
        case 
24_ObjectModel 348;
        case 
25_ObjectModel 349;
        case 
26_ObjectModel 350
        case 
27_ObjectModel 351;
        case 
28_ObjectModel 352;
        case 
29_ObjectModel 353;
        case 
30_ObjectModel 354;
        case 
31_ObjectModel 356;
        case 
32_ObjectModel 372;
        case 
33_ObjectModel 357;
        case 
34_ObjectModel 358;
        case 
35_ObjectModel 359;
        case 
36_ObjectModel 360;
        case 
37_ObjectModel 361;
        case 
38_ObjectModel 362;
        case 
39_ObjectModel 363;
        case 
40_ObjectModel 364;
        case 
41_ObjectModel 365;
        case 
42_ObjectModel 366;
        case 
43_ObjectModel 367;
        case 
44_ObjectModel 368;
        case 
45_ObjectModel 369;
        case 
46_ObjectModel 371;
    }
    return 
_ObjectModel;
}
public 
OnPlayerUpdate(playerid)
{
    return 
PlayerTextDrawSetPreviewModel(playeridWeapon26[playerid], GetObjectModel(playerid));

and not work xD
Reply
#6

News flash: if the player is not holding a weapon that function will still return 0 and hence show the CJ skin, because the CJ skin happens to be model 0.
Reply
#7

If the player holding weapon or not again showing the CJ skin.
What about convert playertextdraw to default textdraw ?
Reply
#8

No, no, no. The whole purpose of a player textdraw is to show different content depending on the individual player. Changing something using global would result in it to change for everyone.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)