Problem with GetPlayerPos
#1

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
Reply
#2

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");
}
Reply
#3

Weird,do you have:
pawn Код:
new Float:P[4];
In your script?
Reply
#4

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
Reply
#5

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
Weird,do you have:
pawn Код:
new Float:P[4];
In your script?
did u check this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)