Hello.Az uj scriptemet keszitem,aminek a lenyege hogy meg tudod nezni hogy milyen billentyuket nyomtal.Ez TextDrawSprite al mukodik,es ha az adott gombot meg nyomod annak el valtozik a szine,es ha elengeded,akkor meg vissza all eredeti szinere.Persze a gombjait masnak is meg nezheted.Na de most nem terek ki arra,hanem lenne egy kis gond.
Par bugg van benne.
Mikor a jarmuben meg nyomom a Q,E gombokat,azaz oldalrol nezes stb akkor az E betu megy rendesen.Pontosabban ha megnyomom az E betut a sprite a terv szerint megvaltoztatja a szinet,es ha elengedem vissza all eredeti szinere,viszont a Q -t hiaba engedem el ha megnyomtam ugyan voros szine lessz.a KEY_UP,DOWN,LEFT,RIGHT sem megy.Ha pedig a jarmuben nyomom a W-t akkor meg a szokoz gomb is kivirul.Nem tudom mi lehet.Meg mutatom a kodot.Probaltam tobb fele keppen,mint peldaul:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_CROUCH)) {
PlayerTextDrawColor(playerid, C[playerid], -16776961);
} else if (RELEASED(KEY_CROUCH)) {
PlayerTextDrawColor(playerid, C[playerid], -1);
} else if (PRESSED(KEY_JUMP)) {
PlayerTextDrawColor(playerid, Ctrl[playerid], -16776961);
} else if (RELEASED(KEY_JUMP)) {
PlayerTextDrawColor(playerid, Ctrl[playerid], -1);
} else if (PRESSED(KEY_FIRE)) {
PlayerTextDrawColor(playerid, LeftClick[playerid], -16776961);
} else if (RELEASED(KEY_FIRE)) {
PlayerTextDrawColor(playerid, LeftClick[playerid], -1);
} else if (PRESSED(KEY_SPRINT)) {
PlayerTextDrawColor(playerid, Space[playerid], -16776961);
} else if (RELEASED(KEY_SPRINT)) {
PlayerTextDrawColor(playerid, Space[playerid], -1);
} else if (PRESSED(KEY_SECONDARY_ATTACK)) {
PlayerTextDrawColor(playerid, Enter[playerid], -16776961);
} else if (RELEASED(KEY_SECONDARY_ATTACK)) {
PlayerTextDrawColor(playerid, Enter[playerid], -1);
} else if (PRESSED(KEY_LOOK_RIGHT)) {
PlayerTextDrawColor(playerid, E[playerid], -16776961);
} else if (RELEASED(KEY_LOOK_RIGHT)) {
PlayerTextDrawColor(playerid, E[playerid], -1);
} else if (PRESSED(KEY_LOOK_LEFT)) {
PlayerTextDrawColor(playerid, Q[playerid], -16776961);
} else if (RELEASED(KEY_LOOK_RIGHT)) {
PlayerTextDrawColor(playerid, Q[playerid], -1);
}
return 1;
}
Mint ahogy mondtam a W,A,S,D sem megy rendesen.
if (PRESSED(KEY_UP))
{
PlayerTextDrawColor(playerid, W[playerid], -16776961);
} else if (RELEASED(KEY_UP)) {
PlayerTextDrawColor(playerid, W[playerid], -1);
return 1;
}
if (PRESSED(KEY_DOWN))
{
PlayerTextDrawColor(playerid, S[playerid], -16776961);
} else if (RELEASED(KEY_DOWN)) {
PlayerTextDrawColor(playerid, S[playerid], -1);
return 1;
}
if (PRESSED(KEY_LEFT))
{
PlayerTextDrawColor(playerid, A[playerid], -16776961);
} else if (RELEASED(KEY_LEFT)) {
PlayerTextDrawColor(playerid, A[playerid], -1);
return 1;
}
if (PRESSED(KEY_RIGHT))
{
PlayerTextDrawColor(playerid, D[playerid], -16776961);
} else if (RELEASED(KEY_RIGHT)) {
PlayerTextDrawColor(playerid, D[playerid], -1);
return 1;
}
Nem vaygok pro,szoval lehet hogy sok a hibam.