27.03.2016, 09:09
PHP код:
/* ISTORIJU AKTORIAI */
/* Pos1, pos2, pos3, angle, cam1, cam2, cam3, skin id, historyType, Score, Money*/
enum aktoriai
{
Float:Pos_x,
Float:Pos_y,
Float:Pos_z,
Float:Pos_A,
Float:cPos_x,
Float:cPos_y,
Float:cPos_z,
skin,
hType,
Score,
Money,
name[24]
};
new Aktorius[ ][aktoriai] =
{
{46.3535,-257.0631,1.7107,264.0349, 58.7866,-258.4310,1.5781, 6, 0, 15, 1500, "VEIKĖJAS NR. 1"},
{43.0988,-242.0966,1.6981,266.5415, 52.0630,-242.7368,1.5781, 6, 1, 20, 1200, "VEIKĖJAS NR. 2"},
{39.6381,-227.6579,1.8262,262.7815, 48.8484,-228.8244,1.5781, 6, 2, 5, 2000, "VEIKĖJAS NR. 3"}
};
new Text3D:AktoriausLabel[sizeof(Aktorius)],
AktoriusID[sizeof(Aktorius)];
PHP код:
for(new x = 0; x < sizeof(Aktorius); x++)
{
AktoriusID[x] = CreateActor( Aktorius[x][skin], Aktorius[x][Pos_x], Aktorius[x][Pos_y], Aktorius[x][Pos_z], Aktorius[x][Pos_A]);
format(g_szBuffer, 450, "{9090D4}%s{ffffff}\nProfesija: {9090D4}%s{ffffff}\nPatirtis:{9090D4}%i{ffffff}\nTurimi pinigai: {9090D4}%i{ffffff} "EURAS".\n \nNorėdami pasirinkt istoriją spauskite {9090D4}ENTER{ffffff} !", Aktorius[x][name], getActorType(Aktorius[x][hType]),Aktorius[x][Score],Aktorius[x][Money]);
AktoriausLabel[x] = Attach3DTextLabelToActor(AktoriusID[x] , g_szBuffer, 0x008080FF, 0.0, 0.0, -0.1, 30.0, 1, 0);
SetActorVirtualWorld(AktoriusID[x] , 1);
}
PHP код:
SendClientMessage(playerid, -1, "{8DBA5F}!{ffffff} Istorijas keisti galite su {8DBA5F}Y{ffffff} ir {8DBA5F}N{ffffff} klaviљais !"); // you can switch histories with Y and N keys
lookingAtactor[playerid] = 0;
SetPlayerCameraPos(playerid, Aktorius[lookingAtactor[playerid]][cPos_x], Aktorius[lookingAtactor[playerid]][cPos_y], Aktorius[lookingAtactor[playerid]][cPos_z]);
SetPlayerCameraLookAt(playerid, Aktorius[lookingAtactor[playerid]][Pos_x], Aktorius[lookingAtactor[playerid]][Pos_y], Aktorius[lookingAtactor[playerid]][Pos_z]);
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(player[playerid][pNewbie] == 1)
{
if(PRESSED(KEY_YES))
{
new next_array;
if(lookingAtactor[playerid] >= sizeof(Aktorius)-1) next_array = 0;
else next_array = lookingAtactor[playerid]++;
InterpolateCameraPos(playerid, Aktorius[lookingAtactor[playerid]][cPos_x], Aktorius[lookingAtactor[playerid]][cPos_y], Aktorius[lookingAtactor[playerid]][cPos_z], Aktorius[next_array][cPos_x], Aktorius[next_array][cPos_y], Aktorius[next_array][cPos_z], 3000, CAMERA_MOVE);
format(g_szBuffer, 148, "ћiūrimo aktoriaus ID: %i ", lookingAtactor[playerid]);
SendClientMessage(playerid, -1, g_szBuffer);
lookingAtactor[playerid] = next_array;
}
if(PRESSED(KEY_NO))
{
new next_array;
if(lookingAtactor[playerid] <= 0) next_array = sizeof(Aktorius)-1;
else next_array = lookingAtactor[playerid]--;
InterpolateCameraPos(playerid, Aktorius[lookingAtactor[playerid]][cPos_x], Aktorius[lookingAtactor[playerid]][cPos_y], Aktorius[lookingAtactor[playerid]][cPos_z], Aktorius[next_array][cPos_x], Aktorius[next_array][cPos_y], Aktorius[next_array][cPos_z], 3000, CAMERA_MOVE);
format(g_szBuffer, 148, "ћiūrimo aktoriaus ID: %i ", lookingAtactor[playerid]);
SendClientMessage(playerid, -1, g_szBuffer);
lookingAtactor[playerid] = next_array;
}
format(g_szBuffer, 148, "aktoriaus ID: %i ", lookingAtactor[playerid]);
SendClientMessage(playerid, -1, g_szBuffer);
}
return 1;
}