08.05.2015, 09:30
(
Последний раз редактировалось Logofero; 08.05.2015 в 18:53.
Причина: Edited
)
SetActorFacingAngle(actorid, Float:ang); // It is working with an error
PHP код:
/**
* GAMEMODE
**/
#define GAMEMODE_NAME "game (lite version)"
#include <a_samp>
#include <a_actor>
#define MAX_MSG_SIZE (256)
#define COLOR_DEFAULT (0xAAAAAAFF)
main()
{
print("\n----------------------------------");
printf(" Gamemode '%s' loaded",GAMEMODE_NAME);
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
new botid[MAX_ACTORS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mbot", cmdtext, true, 10) == 0)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
for(new i; i < MAX_ACTORS; i++) {
if(!IsValidActor(i)) {
CreateActor(random(299), x,y,z, a);
SetActorHealth(i, 100.0);
//ApplyActorAnimation(botid[i], "PED", "WALK_drunk", 4.1, 1, 1, 1, 1, 0);
//ApplyActorAnimation(botid[i], "CHAINSAW", "CSAW_1", 4.1, 1, 1, 1, 1, 0);
//SetActorInvulnerable(botid[i], true);
break;
}
}
return 1;
}
if (strcmp("/dbot", cmdtext, true, 10) == 0)
{
for(new i; i < MAX_ACTORS; i++) {
if(IsValidActor(i)) DestroyActor(i);
}
return 1;
}
if (strcmp("/hbot", cmdtext, true, 10) == 0)
{
for(new i; i < MAX_ACTORS; i++) {
if(IsValidActor(i)) SetActorHealth(i, 0.0);
}
return 1;
}
if (strcmp("/h2bot", cmdtext, true, 10) == 0)
{
for(new i; i < MAX_ACTORS; i++) {
SetActorHealth(i, 100.0);
}
return 1;
}
if (strcmp("/abot", cmdtext, true, 10) == 0)
{
for(new i; i < MAX_ACTORS; i++) {
if(IsValidActor(i)) {
new msg[MAX_MSG_SIZE];
new Float:a;
GetActorFacingAngle(i, a);
format(msg, MAX_MSG_SIZE, "GetActorFacingAngle actor %d current_angle %.1f", i, a);
SendClientMessage(playerid, COLOR_DEFAULT, msg);
SetActorFacingAngle(i, 180.0);
GetActorFacingAngle(i, a);
format(msg, MAX_MSG_SIZE, "SetActorFacingAngle actor %d set 180.0 current_angle %.1f", i, a);
SendClientMessage(playerid, COLOR_DEFAULT, msg);
}
}
return 1;
}
return 0;
}
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart) {
if(IsValidActor(damaged_actorid)) {
new msg[MAX_MSG_SIZE];
new Float:hp;
GetActorHealth(damaged_actorid, hp);
format(msg, MAX_MSG_SIZE, "OnGiveDMG player %d <weaponid %d dmg %.1f> actor %d hp %.1f", playerid, weaponid, amount, damaged_actorid, hp);
SendClientMessage(playerid, COLOR_DEFAULT, msg);
}
return 1;
}