SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 08/05/2015, 10:30 AM   #1
Logofero
Huge Clucker
 
Join Date: Sep 2014
Posts: 366
Reputation: 39
Default [Bug/SRV 0.3.7] Actor does not rotated

SetActorFacingAngle(actorid, Float:ang); // It is working with an error

PHP Code:
/**
 * 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(01958.37831343.157215.3746269.1425000000);
    return 
1;
}

public 
OnGameModeExit()
{
    return 
1;
}

public 
OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}

public 
OnPlayerConnect(playerid)
{
    return 
1;
}

public 
OnPlayerDisconnect(playeridreason)
{
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    return 
1;
}

public 
OnPlayerDeath(playeridkilleridreason)
{
    return 
1;
}

public 
OnVehicleSpawn(vehicleid)
{
    return 
1;
}

public 
OnVehicleDeath(vehicleidkillerid)
{
    return 
1;
}

public 
OnPlayerText(playeridtext[])
{
    return 
1;
}

new 
botid[MAX_ACTORS];
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/mbot"cmdtexttrue10) == 0)
    {
    
        new 
Float:xFloat:yFloat:zFloat:a;
        
GetPlayerPos(playeridx,y,z);
        
GetPlayerFacingAngle(playerida);
    
        for(new 
iMAX_ACTORSi++) {
            if(!
IsValidActor(i)) {
                
CreateActor(random(299), x,y,za);
                
SetActorHealth(i100.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"cmdtexttrue10) == 0)
    {
        for(new 
iMAX_ACTORSi++) {
            if(
IsValidActor(i)) DestroyActor(i);
        }
        return 
1;
    }

    if (
strcmp("/hbot"cmdtexttrue10) == 0)
    {
        for(new 
iMAX_ACTORSi++) {
            if(
IsValidActor(i)) SetActorHealth(i0.0);
        }
        return 
1;
    }

    if (
strcmp("/h2bot"cmdtexttrue10) == 0)
    {
        for(new 
iMAX_ACTORSi++) {
            
SetActorHealth(i100.0);
        }
        return 
1;
    }

    if (
strcmp("/abot"cmdtexttrue10) == 0)
    {
        for(new 
iMAX_ACTORSi++) {
            if(
IsValidActor(i)) {

                new 
msg[MAX_MSG_SIZE];
                new 
Float:a;
                
                
GetActorFacingAngle(ia);
                
format(msgMAX_MSG_SIZE"GetActorFacingAngle actor %d current_angle %.1f"ia);
                
SendClientMessage(playeridCOLOR_DEFAULTmsg);
                
                
SetActorFacingAngle(i180.0);
                
                
GetActorFacingAngle(ia);
                
format(msgMAX_MSG_SIZE"SetActorFacingAngle actor %d set 180.0 current_angle %.1f"ia);
                
SendClientMessage(playeridCOLOR_DEFAULTmsg);
            }
        }
                return 
1;
    }
    
    return 
0;
}

public 
OnPlayerGiveDamageActor(playeriddamaged_actoridFloat:amountweaponidbodypart) {

    if(
IsValidActor(damaged_actorid)) {
        new 
msg[MAX_MSG_SIZE];
        new 
Float:hp;
        
GetActorHealth(damaged_actoridhp);
        
format(msgMAX_MSG_SIZE"OnGiveDMG player %d <weaponid %d dmg %.1f> actor %d hp %.1f"playeridweaponidamountdamaged_actoridhp);
        
SendClientMessage(playeridCOLOR_DEFAULTmsg);
    }
    return 
1;

Attached Images
File Type: jpg sa-mp-092.jpg (186.9 KB, 50 views)
__________________
My channel

Last edited by Logofero; 08/05/2015 at 07:53 PM. Reason: Edited
Logofero is offline   Reply With Quote
Old 08/05/2015, 10:45 AM   #2
papedo
Big Clucker
 
papedo's Avatar
 
Join Date: Oct 2009
Location: Czech Republic
Posts: 162
Reputation: 6
Default Re: [Bug/SRV 0.3.7] Actor does not rotated

You have no return in this command

pawn Code:
if (strcmp("/abot", cmdtext, true, 10) == 0)
{
    if(IsValidActor(0)) {

        new msg[MAX_MSG_SIZE];
        new Float:a;
                 
        GetActorFacingAngle(0, a);
        format(msg, MAX_MSG_SIZE, "GetActorFacingAngle actor %d current_angle %.1f", 0, a);
        SendClientMessage(playerid, COLOR_DEFAULT, msg);
                 
        SetActorFacingAngle(0, 180.0);
                 
        GetActorFacingAngle(0, a);
        format(msg, MAX_MSG_SIZE, "SetActorFacingAngle actor %d set 180.0 current_angle %.1f", 0, a);
        SendClientMessage(playerid, COLOR_DEFAULT, msg);
    }
    return 1;
}
papedo is offline   Reply With Quote
Old 08/05/2015, 10:52 AM   #3
Logofero
Huge Clucker
 
Join Date: Sep 2014
Posts: 366
Reputation: 39
Default Re: [Bug/SRV 0.3.7] Actor does not rotated

Quote:
Originally Posted by papedo View Post
You have no return in this command

pawn Code:
if (strcmp("/abot", cmdtext, true, 10) == 0)
{
    if(IsValidActor(0)) {

        new msg[MAX_MSG_SIZE];
        new Float:a;
                 
        GetActorFacingAngle(0, a);
        format(msg, MAX_MSG_SIZE, "GetActorFacingAngle actor %d current_angle %.1f", 0, a);
        SendClientMessage(playerid, COLOR_DEFAULT, msg);
                 
        SetActorFacingAngle(0, 180.0);
                 
        GetActorFacingAngle(0, a);
        format(msg, MAX_MSG_SIZE, "SetActorFacingAngle actor %d set 180.0 current_angle %.1f", 0, a);
        SendClientMessage(playerid, COLOR_DEFAULT, msg);
    }
    return 1;
}
It does not fix the error in SetActorFacingAngle();
__________________
My channel
Logofero is offline   Reply With Quote
Old 08/05/2015, 12:28 PM   #4
long76
Big Clucker
 
Join Date: Aug 2013
Posts: 152
Reputation: 1
Default Re: [Bug/SRV 0.3.7] Actor does not rotated

f**k! try it
pawn Code:
/**
 * GAMEMODE
 **/

#define GAMEMODE_NAME "game (lite version)"

#include <a_samp>
#include <a_actor>

#define MAX_MSG_SIZE (256)
#define COLOR_DEFAULT (0xAAAAAAFF)

new pactor[MAX_PLAYERS];

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);              
        pactor[playerid]=CreateActor(random(299), x,y,z, a);
         SetActorHealth(pactor[playerid], 100.0);                
     return 1;
    }
     
    if (strcmp("/dbot", cmdtext, true, 10) == 0)
    {
       
            if(IsValidActor(pactor[playerid])) DestroyActor(pactor[playerid]);
       
        return 1;
    }

    if (strcmp("/hbot", cmdtext, true, 10) == 0)
    {
       
            if(IsValidActor(pactor[playerid])) SetActorHealth(pactor[playerid], 0.0);  
        return 1;
    }

    if (strcmp("/h2bot", cmdtext, true, 10) == 0)
    {        
           if(IsValidActor(pactor[playerid])) SetActorHealth(pactor[playerid], 100.0);        
        return 1;
    }

    if (strcmp("/abot", cmdtext, true, 10) == 0)
    {  
            if(IsValidActor(pactor[playerid])) {

                new msg[MAX_MSG_SIZE];
                new Float:a;
                 
                GetActorFacingAngle(pactor[playerid], a);
                format(msg, MAX_MSG_SIZE, "GetActorFacingAngle actor %d current_angle %.1f", i, a);
                SendClientMessage(playerid, COLOR_DEFAULT, msg);
                 
                SetActorFacingAngle(pactor[playerid], 180.0);
                 
                GetActorFacingAngle(pactor[playerid], 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;
}
long76 is offline   Reply With Quote
Old 11/05/2015, 01:45 AM   #5
PaulDinam
Gangsta
 
Join Date: Jun 2011
Posts: 887
Reputation: 45
Default Re: [Bug/SRV 0.3.7] Actor does not rotated

It's a known bug, I have it too.
PaulDinam is offline   Reply With Quote
Old 23/05/2015, 03:28 PM   #6
Kyle
High-roller
 
Kyle's Avatar
 
Join Date: Mar 2009
Location: United Kingdom
Posts: 2,258
Reputation: 330
Default Re: [Bug/SRV 0.3.7] Actor does not rotated

Quote:
Originally Posted by PaulDinam View Post
It's a known bug, I have it too.
Did you stream out and restream? Does the new rotation apply?
Kyle is offline   Reply With Quote
Old 01/06/2015, 03:33 AM   #7
PaulDinam
Gangsta
 
Join Date: Jun 2011
Posts: 887
Reputation: 45
Default Re: [Bug/SRV 0.3.7] Actor does not rotated

No I simply rotated the actor and the actor stayed at his original rotation pos when created.
PaulDinam is offline   Reply With Quote
Old 01/06/2015, 10:36 AM   #8
Stanford
Gangsta
 
Stanford's Avatar
 
Join Date: Feb 2012
Posts: 984
Reputation: 84
Default Re: [Bug/SRV 0.3.7] Actor does not rotated

Try destroying it and then creating it with the new facing angle.
__________________
******: "That code compiles perfectly, but I can tell you now it won't make me a cup of tea."

******: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."
Stanford is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Интерьеры Actor Dembel Русский/Russian 3 05/05/2015 07:19 PM
Why can not actor walk? LikeNPC Scripting Help 4 02/05/2015 08:06 PM
Rotated doors? davve95 General 6 07/06/2012 01:43 PM
Why are all the gates in my 0.3d server rotated? Tass007 Scripting Help 20 22/04/2012 06:16 AM
Screen Rotated Whatt the.? Riddy Client Support 3 27/01/2011 12:45 PM


All times are GMT. The time now is 04:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.