Attach Object To Player -
SnAcH - 21.04.2009
Why Is This Not Working
line 99: public OnPlayerCommandText(playerid, cmdtext[])
line 100: {
line 101: if (strcmp(cmdtext, "/chicken", true) == 0)
line 102: {
line 103: new float:X,float:Y,float:Z;
line 104: new chicken;
line 105: GetPlayerPos(playerid,float:X,float:Y,float:Z);
line 106: CreateObject(16776,float:X,float:Y,float:Z,0,0,0 );
line 107: AttachObjectToPlayer(chicken, playerid, 0, 0, 0, 0, 0, 0);
line 108: return 1;
line 109: }
line 110: return 0;
line 111: }
Warnings:
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(105) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(105) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(105) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(106) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(106) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(106) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(10

: warning 217: loose indentation
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(110) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
8 Warnings.
Re: Attach Object To Player -
yom - 21.04.2009
Float values are declared with tag
Float
And once declared, you don't need to always put the tag in front of them.
Re: Attach Object To Player -
SnAcH - 21.04.2009
sorry ime kinda new to pawn little help on what that means?
Re: Attach Object To Player -
yom - 21.04.2009
That mean this:
pawn Код:
new float:X,float:Y,float:Z;
...
GetPlayerPos(playerid,float:X,float:Y,float:Z);
CreateObject(16776,float:X,float:Y,float:Z,0,0,0 );
should be like this:
pawn Код:
new Float:X, Float:Y, Float:Z;
...
GetPlayerPos(playerid, X, Y, Z);
CreateObject(16776, X, Y, Z, 0, 0, 0);
Re: Attach Object To Player -
StrickenKid - 21.04.2009
Код:
line 106: CreateObject(16776,float:X,float:Y,float:Z,0,0,0 );
line 107: AttachObjectToPlayer(monkey, playerid, 0, 0, 0, 0, 0, 0);
where the heck did "monkey" come from?
and your using floats wrong;
and if your doing /chicken, i have no idea why you would use monkey as the var;
this is how it needs to be done:
Код:
//top:
new chicken[MAX_PLAYERS];
//edit for command:
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
line 106: chicken[playerid] = CreateObject(16776,X,Y,Z,0,0,0 );
line 107: AttachObjectToPlayer(chicken[playerid], playerid, 0, 0, 0, 0, 0, 0);
you need to read the wiki, it explains everything.
Re: Attach Object To Player -
SnAcH - 21.04.2009
woops lol i had it originaly planned out as a monkey its changed noq
Re: Attach Object To Player -
SnAcH - 21.04.2009
Can Someone Give Me The Whole Code Ime Still Having Errors
Code Now:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/chicken", true) == 0)
{
new float:X,float:Y,float:Z;
new monkey;
GetPlayerPos(playerid,X,Y,Z);
monkey = CreateObject(16776,X,Y,Z,0.00,0.00,0.00);
AttachObjectToPlayer( monkey, playerid, 0, 0, 0, 0, 0, 0);
return 1;
}
return 0;
}
Warnings:
Код:
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(105) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(105) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(105) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(106) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(106) : warning 213: tag mismatch
C:\Users\CTAMOD623\Desktop\Testing Script.pwn(106) : warning 213: tag mismatch
Re: Attach Object To Player -
yom - 21.04.2009
As said twice, it is "Float" not "float". And these are not errors but warnings.
Re: Attach Object To Player -
SnAcH - 21.04.2009
YES... warnings can make a function in the script not work