Turtle
#1

Anyone knows what the turtles cords should be that he would walk on your right??
PHP код:
SetPlayerAttachedObject(playerid,4,1609,10,0,0,0,0,0,0,0,0,0); 
Reply
#2

use a timer then get the player coord and set the turtle moving to your position
Reply
#3

any idea how to do that?

im not so good in scripting yet
Reply
#4

PHP код:
COMMAND:buyturtle(playerid,params[])
{
    if 
GetPlayerScore(playerid) >= 1000*then
    
{
    
GetPlayerPos(playerid,x1,y1,z1);
    
GetPlayerFacingAngle(playerida);
    
SetPlayerAttachedObject(playerid,4,1609,10,x1,y1 3,z1,0,0,a,0,0,0);
    
SendClientMessage(playerid0x00FF00FF,"You have bought turtle");
    
RewardPlayer(playerid, -400000);
    }
    return 
1;

Why doenst turtle show up
Reply
#5

pawn Код:
new Squirtle[MAX_PLAYERS];
new SquirtleTime[MAX_PLAYERS];

forward Squirtle_I_Choose_Youuuuu(playerid)
public Squirtle_I_Choose_Youuuuu(playerid)
{
    new Float:phrr[4];
    GetPlayerPos(playerid, phrr[0],phrr[1],phrr[2]);
    //GetPlayerFacingAngle(playerid, phrr[3]);
    MoveObject(Squirtle[playerid], phrr[0]+0.5,phrr[1],phrr[2]/*,phrr[3],0,0*/);//uncomment this and the facing angle line if yo're using 0.3D
}

COMMAND:GOsquirtle(playerid,params[])
{
    if( GetPlayerScore(playerid) >= 1000)
    {
        new Float:x1,Float:y1,Float:z1,Float:a;
        GetPlayerPos(playerid,x1,y1,z1);;
        GetPlayerFacingAngle(playerid, a);
        Squirtle[playerid] = CreateObject(1609,x1,y1,z1-1,a,0.0,0.0);
        SquirtleTime[playerid] = SetTimerEx("Squirtle_I_Choose_Youuuuu",1000,true, "i", playerid);
        SendClientMessage(playerid, 0x00FF00FF,"You have bought turtle");
        RewardPlayer(playerid, -40000, 0);
    }
    return 1;
}

//OnPlayerDisconnect or when he leave the turtle
KillTimer(SquirtleTime[playerid]);
i did this while i was talkin with my mother on skype so i'm sorry if have some problem...
Reply
#6

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
pawn Код:
new Squirtle[MAX_PLAYERS];
new SquirtleTime[MAX_PLAYERS];

forward Squirtle_I_Choose_Youuuuu(playerid)
public Squirtle_I_Choose_Youuuuu(playerid)
{
    new Float:phrr[4];
    GetPlayerPos(playerid, phrr[0],phrr[1],phrr[2]);
    //GetPlayerFacingAngle(playerid, phrr[3]);
    MoveObject(Squirtle[playerid], phrr[0]+0.5,phrr[1],phrr[2]/*,phrr[3],0,0*/);//uncomment this and the facing angle line if yo're using 0.3D
}

COMMAND:GOsquirtle(playerid,params[])
{
    if( GetPlayerScore(playerid) >= 1000)
    {
        new Float:x1,Float:y1,Float:z1,Float:a;
        GetPlayerPos(playerid,x1,y1,z1);;
        GetPlayerFacingAngle(playerid, a);
        Squirtle[playerid] = CreateObject(1609,x1,y1,z1-1,a,0.0,0.0);
        SquirtleTime[playerid] = SetTimerEx("Squirtle_I_Choose_Youuuuu",1000,true, "i", playerid);
        SendClientMessage(playerid, 0x00FF00FF,"You have bought turtle");
        RewardPlayer(playerid, -40000, 0);
    }
    return 1;
}

//OnPlayerDisconnect or when he leave the turtle
KillTimer(SquirtleTime[playerid]);
i did this while i was talkin with my mother on skype so i'm sorry if have some problem...
Why do this, when you can just fix his code ?

Quote:
Originally Posted by wumpyc
Посмотреть сообщение
PHP код:
COMMAND:buyturtle(playerid,params[])
{
    if 
GetPlayerScore(playerid) >= 1000*then
    
{
    
GetPlayerPos(playerid,x1,y1,z1);
    
GetPlayerFacingAngle(playerida);
    
SetPlayerAttachedObject(playerid,4,1609,10,x1,y1 3,z1,0,0,a,0,0,0);
    
SendClientMessage(playerid0x00FF00FF,"You have bought turtle");
    
RewardPlayer(playerid, -400000);
    }
    return 
1;

Why doenst turtle show up
top of your script:

PHP код:
#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1) 
PHP код:
COMMAND:buyturtle(playerid,params[])
{
    if 
GetPlayerScore(playerid) >= 1000*then
    
{
    
GetPlayerPos(playerid,x1,y1,z1);
    
GetPlayerFacingAngle(playerida);
    
SetPlayerAttachedObject(playerid416098);
    
SendClientMessage(playerid0x00FF00FF,"You have bought turtle");
    
RewardPlayer(playerid, -400000);
    }
    return 
1;

I set this to your right foot, since you can't use SetPlayerAttachedObject for something that you aren't actually attaching to you. OR, I believe you can change the index.
Reply
#7

because using moveobject will be 1000% more realistic...
Reply
#8

i edited yours pharrel and work great
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)