04.01.2015, 20:32
I'm working on a skin selection on which you walk into a pickup and then you should be able to choose a skin (third person view-> similar to spawn selection)
I'm getting set into the right position and freezed when walking into the pickup, although it seems not to detect the keys
The actual timer
calling the timer:
and ofc the arrays
any idea why it won't work?
I'm getting set into the right position and freezed when walking into the pickup, although it seems not to detect the keys
The actual timer
pawn Код:
public SelectSkin(playerid)
{
if(GetPVarInt(playerid, "SelectSkin") == 1)
{
new Keys,ud,lr, skintype = GetPVarInt(playerid, "SkinTypes"), m = GetPVarInt(playerid, "SkinNumber");
GetPlayerKeys(playerid,Keys,ud,lr);
if(lr == KEY_RIGHT)
{
if(m == MaxSkinNumber[skintype] - 1)
{
SetPlayerSkin(playerid, SkinSelects[skintype][0]);
m = 0;
}
else
{
SetPlayerSkin(playerid, SkinSelects[skintype][m+1]);
m++;
}
}
else if(lr == KEY_LEFT)
{
if(m == 0)
{
m = MaxSkinNumber[skintype] - 1;
SetPlayerSkin(playerid, SkinSelects[skintype][m]);
}
else
{
SetPlayerSkin(playerid, SkinSelects[skintype][m-1]);
m--;
}
}
SetPVarInt(playerid, "SkinNumber", m);
}
return 1;
}
pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
else if(PickUps[pickupid][puspec] == 2) //skin selects
{
if(GetPVarInt(playerid, "SkinSelect") == 0)
{
SetPlayerPos(playerid, 2252.799316, 2491.290039, 10.990804);
SetPlayerFacingAngle(playerid, 177.721267);
TogglePlayerControllable(playerid, 0);
SetPlayerCameraPos(playerid, 2252.898437, 2488.629150, 10.990804);
SetPlayerCameraLookAt(playerid, 2252.799316, 2491.290039, 10.990804);
SetPVarInt(playerid, "SkinSelect", 1);
SetPVarInt(playerid, "SkinTypes", 0);
SetPVarInt(playerid, "SkinNumber", 0);
SetPlayerSkin(playerid, SkinSelects[0][0]);
SkinSelectTimer[playerid] = SetTimerEx("SelectSkin", 200, true, "i", playerid);
}
}
return 1;
}
pawn Код:
new MaxSkinNumber[] =
{
9 //Police Skins
};
new SkinSelects[1][] =
{
{265, 266, 267, 280, 281, 282, 283, 284, 288} //Police Skins
};