public NearByMessage- help please -
Crossfire1989 - 21.01.2013
when i go to compile the script i get the following errors
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(531) : error 025: function heading differs from prototype
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : error 012: invalid function call, not a valid address
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : warning 215: expression has no effect
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : error 001: expected token: ";", but found ")"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : error 029: invalid expression, assumed zero
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
and now this here is Line 531-548
Код:
public NearByMessage(playerid, color, string[], Float: range)
{
new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerSpawned(i))
{
GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
if(IsPlayerInRangeOfPoint(i, range, PlayerX, PlayerY, PlayerZ))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
SendClientMessage(i, color, string);
}
}
}
}
}
Re: public NearByMessage- help please -
Jakku - 21.01.2013
Your code compiles fine for me. Make sure you have forwarded it correctly
pawn Код:
forward NearByMessage(playerid, color, string[], Float: range);
Re: public NearByMessage- help please -
DiGiTaL_AnGeL - 21.01.2013
Show me the forward too, and post both between [pawn ] [/pawn ]
EDIT:Sorry Jakku, I had to wait 120 seconds for another post, didn't see you've posted.
Re: public NearByMessage- help please -
Infinity90 - 21.01.2013
You have
pawn Код:
forward NearByMessage(playerid, color, string[], Float: range);
Show us your value of IsPlayerSpawn, I compiled it with no errors (except IsPlayerSpawn).
Re: public NearByMessage- help please -
Crossfire1989 - 21.01.2013
ok now i get
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(453) : warning 202: number of arguments does not match definition
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(472) : warning 202: number of arguments does not match definition
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : error 012: invalid function call, not a valid address
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : warning 215: expression has no effect
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : error 001: expected token: ";", but found ")"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : error 029: invalid expression, assumed zero
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(536) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
SendClientMessage(playerid, WHITE, "Vehicle engine stopped successfully.");
line 453= NearByMessage(playerid, PURPLE, msg);
DeletePVar(playerid, "fuelonoff");
format(msg, sizeof(msg), " ** %s starts the engine of their vehicle.", Character);
line 472= NearByMessage(playerid, PURPLE, msg);
arr_Engine{vehicleid} = 1;
Код:
public NearByMessage(playerid, color, string[], Float: range)
{
new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
line 536=
Код:
if(IsPlayerConnected(i) && IsPlayerSpawned(i))
{
GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
if(IsPlayerInRangeOfPoint(i, range, PlayerX, PlayerY, PlayerZ))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
SendClientMessage(i, color, string);
}
}
}
}
}
Re: public NearByMessage- help please -
Crossfire1989 - 21.01.2013
Quote:
Originally Posted by Infinity90
You have
pawn Код:
forward NearByMessage(playerid, color, string[], Float: range);
Show us your value of IsPlayerSpawn, I compiled it with no errors (except IsPlayerSpawn).
|
here is where my isplayer is at
Код:
new IsPlayerSpawned[MAX_PLAYERS];
Код:
public NearByMessage(playerid, color, string[], Float: range)
{
new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerSpawned(i))
{
GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
if(IsPlayerInRangeOfPoint(i, range, PlayerX, PlayerY, PlayerZ))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
SendClientMessage(i, color, string);
}
}
}
}
}
Re: public NearByMessage- help please -
Jakku - 21.01.2013
This is where it fails.
IsPlayerSpawned(i) ->> IsPlayerSpawned[i]
Re: public NearByMessage- help please -
Crossfire1989 - 21.01.2013
Quote:
Originally Posted by Jakku
This is where it fails.
IsPlayerSpawned(i) ->> IsPlayerSpawned[i]
|
so what would i place there?
Re: public NearByMessage- help please -
Infinity90 - 21.01.2013
pawn Код:
// change this line
if(IsPlayerConnected(i) && IsPlayerSpawned(i))
// too this
if(IsPlayerConnected(i) && IsPlayerSpawned[i])
Re: public NearByMessage- help please -
Crossfire1989 - 21.01.2013
Quote:
Originally Posted by Infinity90
pawn Код:
// change this line if(IsPlayerConnected(i) && IsPlayerSpawned(i)) // too this if(IsPlayerConnected(i) && IsPlayerSpawned[i])
|
as soon as i do that i get these
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(453) : warning 202: number of arguments does not match definition
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(472) : warning 202: number of arguments does not match definition
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(3215) : error 017: undefined symbol "SetVehicleDoors"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(3230) : error 017: undefined symbol "GetClosestCar"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(3231) : error 017: undefined symbol "IsPlayerInRangeOfVehicle"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(3254) : error 017: undefined symbol "GetClosestCar"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(3255) : error 017: undefined symbol "IsPlayerInRangeOfVehicle"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(3319) : error 017: undefined symbol "panels"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(3320) : error 017: undefined symbol "panels"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(440
: error 017: undefined symbol "engine"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4411) : error 017: undefined symbol "boot"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4414) : error 017: undefined symbol "engine"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4433) : error 017: undefined symbol "engine"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4436) : error 017: undefined symbol "boot"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4439) : error 017: undefined symbol "engine"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(445
: error 017: undefined symbol "engine"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4461) : error 017: undefined symbol "boot"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4464) : error 017: undefined symbol "engine"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4483) : error 017: undefined symbol "engine"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4486) : error 017: undefined symbol "boot"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4490) : error 017: undefined symbol "engine"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4565) : error 017: undefined symbol "panels"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4566) : error 017: undefined symbol "panels"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(457
: error 017: undefined symbol "panels"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4579) : error 017: undefined symbol "panels"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4580) : error 017: undefined symbol "panels"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4581) : error 017: undefined symbol "panels"
C:\Users\Gharrett\Desktop\Scratch Roleplay\gamemodes\ScratchRP.pwn(4582) : error 017: undefined symbol "panels"
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
26 Errors.