Problem with GetPlayerPos -
Libra_PL - 27.08.2010
I have got a next problem with my script, I hope you guys will fix this... Please fix all this script... Thanks
The script:
Код:
dcmd_chp(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 5) {
GetPlayerPos(playerid,P[0],P[1],P[2]); //HERE ARE ERRORS
GetPlayerFacingAngle(playerid,P[3]);
format(str,128,"You have created a Hidden Package! Use command /say or /announce to tell other to find this!");
SendClientMessage(blue,str);
if(Package != 0) DestroyPickup(Package);
P[0] += (1.0 * floatsin(-P[3], degrees));
P[1] += (1.0 * floatcos(-P[3], degrees));
Package = CreatePickup(1210,P[0],P[1],P[2]-0.5,0.0,0.0,0.0);
} else return SendClientMessage(playerid,red,"ERROR: Only Admins with level 5 and higher can use this command");
}
Errors I get:
...filterscripts\Adminscript.pwn(2346) : error 017: undefined symbol "P"
...filterscripts\Adminscript.pwn(2346) : warning 215: expression has no effect
...filterscripts\Adminscript.pwn(2346) : error 001: expected token: ";", but found "]"
...filterscripts\Adminscript.pwn(2346) : error 029: invalid expression, assumed zero
...filterscripts\Adminscript.pwn(2346) : fatal error 107: too many error messages on one line
Lib
Re: Problem with GetPlayerPos -
Dime - 27.08.2010
Not sure but try:
Код:
dcmd_chp(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 5) {
new Float:P[0],Float:P[1],Float:P[2];
GetPlayerPos(playerid,P[0],P[1],P[2]); //HERE ARE ERRORS
GetPlayerFacingAngle(playerid,P[3]);
format(str,128,"You have created a Hidden Package! Use command /say or /announce to tell other to find this!");
SendClientMessage(blue,str);
if(Package != 0) DestroyPickup(Package);
P[0] += (1.0 * floatsin(-P[3], degrees));
P[1] += (1.0 * floatcos(-P[3], degrees));
Package = CreatePickup(1210,P[0],P[1],P[2]-0.5,0.0,0.0,0.0);
} else return SendClientMessage(playerid,red,"ERROR: Only Admins with level 5 and higher can use this command");
}
Re: Problem with GetPlayerPos -
[XST]O_x - 27.08.2010
Weird,do you have:
In your script?
Re: Problem with GetPlayerPos -
Libra_PL - 27.08.2010
I tried and I get these errors:
...filterscripts\Adminscript.pwn(2346) : error 009: invalid array size (negative, zero or out of bounds)
...filterscripts\Adminscript.pwn(2346) : error 029: invalid expression, assumed zero
...filterscripts\Adminscript.pwn(2346) : warning 221: label name "Float" shadows tag name
...filterscripts\Adminscript.pwn(2346) : error 017: undefined symbol "P"
...filterscripts\Adminscript.pwn(2346) : fatal error 107: too many error messages on one line
The same line.
___
[XST]O_x,
If I add this to the script, I get a lot of warnings, but here are them:
...filterscripts\Adminscript.pwn(2347) : warning 219: local variable "P" shadows a variable at a preceding level
...filterscripts\Adminscript.pwn(2347) : error 009: invalid array size (negative, zero or out of bounds)
...filterscripts\Adminscript.pwn(2347) : error 029: invalid expression, assumed zero
...filterscripts\Adminscript.pwn(2347) : warning 221: label name "Float" shadows tag name
...filterscripts\Adminscript.pwn(2347) : warning 215: expression has no effect
...filterscripts\Adminscript.pwn(2347) : warning 215: expression has no effect
...filterscripts\Adminscript.pwn(2350) : error 017: undefined symbol "str"
...filterscripts\Adminscript.pwn(2351) : error 017: undefined symbol "str"
...filterscripts\Adminscript.pwn(2355) : warning 213: tag mismatch
...filterscripts\Adminscript.pwn(2355) : warning 213: tag mismatch
...filterscripts\Adminscript.pwn(2355) : warning 202: number of arguments does not match definition
...filterscripts\Adminscript.pwn(2357) : warning 209: function "dcmd_chp" should return a value
...filterscripts\Adminscript.pwn(2347) : warning 203: symbol is never used: "Float"
...filterscripts\Adminscript.pwn(2344) : warning 203: symbol is never used: "params"
Lib
Re: Problem with GetPlayerPos -
Dime - 27.08.2010
Quote:
Originally Posted by [XST]O_x
Weird,do you have:
In your script?
|
did u check this?