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(playerid, a);
SetPlayerAttachedObject(playerid,4,1609,10,x1,y1 + 3,z1,0,0,a,0,0,0);
SendClientMessage(playerid, 0x00FF00FF,"You have bought turtle");
RewardPlayer(playerid, -40000, 0);
}
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(playerid, a);
SetPlayerAttachedObject(playerid, 4, 1609, 8);
SendClientMessage(playerid, 0x00FF00FF,"You have bought turtle");
RewardPlayer(playerid, -40000, 0);
}
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.