1 little error +warns
#1

Код:
F:\Fun and Games server\gamemodes\Freeroam1.pwn(4563) : warning 208: function with tag result used before definition, forcing reparse
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5191) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5242) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5341) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5466) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5589) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5698) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5808) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5874) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6225) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6277) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6328) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6380) : error 030: compound statement not closed at the end of file (started at line 4654)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
http://pastebin.com/PQvwqAfz
Reply
#2

help
Reply
#3

I'm taking a complete swing in the dark but


Код:
Float:GetDistanceToPoint(playerid,Float:x2,Float:y2,Float:z2)
{
        if (IsPlayerConnected(playerid))
        {
                new Float:x1,Float:y1,Float:z1;
                GetPlayerPos(playerid,x1,y1,z1);
                return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
        }
        return 9999.9;
}
I'm sure it needs to be


Код:
stock Float:GetDistanceToPoint(playerid,Float:x2,Float:y2,Float:z2)
{
        if (IsPlayerConnected(playerid))
        {
                new Float:x1,Float:y1,Float:z1;
                GetPlayerPos(playerid,x1,y1,z1);
                return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
        }
        return 9999.9;
}
(mind me i'm new to scripting, so sorry if it doesnt help)
Reply
#4

when i put
pawn Код:
stock Float:GetDistanceToPoint(playerid,Float:x2,Float:y2,Float:z2)
{
        if (IsPlayerConnected(playerid))
        {
                new Float:x1,Float:y1,Float:z1;
                GetPlayerPos(playerid,x1,y1,z1);
                return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
        }
        return 9999.9;
}

i got more errors
Код:
F:\Fun and Games server\gamemodes\Freeroam1.pwn(4567) : warning 208: function with tag result used before definition, forcing reparse
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5191) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5242) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5341) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5466) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5589) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5698) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5808) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(5874) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6225) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6277) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6328) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6379) : error 029: invalid expression, assumed zero
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6379) : warning 221: label name "Float" shadows tag name
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6379) : error 017: undefined symbol "x2"
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6385) : error 017: undefined symbol "x2"
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6385) : warning 213: tag mismatch
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6387) : warning 213: tag mismatch
F:\Fun and Games server\gamemodes\Freeroam1.pwn(6390) : error 030: compound statement not closed at the end of file (started at line 4654)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
help plz
Reply
#5

help
Reply
#6

i need help fast
Reply
#7

Quote:
Originally Posted by Marco_Valentine
Посмотреть сообщение
I'm taking a complete swing in the dark but


Код:
Float:GetDistanceToPoint(playerid,Float:x2,Float:y2,Float:z2)
{
        if (IsPlayerConnected(playerid))
        {
                new Float:x1,Float:y1,Float:z1;
                GetPlayerPos(playerid,x1,y1,z1);
                return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
        }
        return 9999.9;
}
I'm sure it needs to be


Код:
stock Float:GetDistanceToPoint(playerid,Float:x2,Float:y2,Float:z2)
{
        if (IsPlayerConnected(playerid))
        {
                new Float:x1,Float:y1,Float:z1;
                GetPlayerPos(playerid,x1,y1,z1);
                return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
        }
        return 9999.9;
}
(mind me i'm new to scripting, so sorry if it doesnt help)
I don't think thats right.

If not try this

pawn Код:
stock GetDistanceToPoint(playerid,Float:x2,Float:y2,Float:z2)
{
        if (IsPlayerConnected(playerid))
        {
                new Float:x1,Float:y1,Float:z1;
                GetPlayerPos(playerid,x1,y1,z1);
                return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
        }
        return 9999.9;
}


Edit: whats with return 9999.9; ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)