public NearByMessage- help please
#1

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

Your code compiles fine for me. Make sure you have forwarded it correctly

pawn Код:
forward NearByMessage(playerid, color, string[], Float: range);
Reply
#3

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.
Reply
#4

You have
pawn Код:
forward NearByMessage(playerid, color, string[], Float: range);
Show us your value of IsPlayerSpawn, I compiled it with no errors (except IsPlayerSpawn).
Reply
#5

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

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

This is where it fails.

IsPlayerSpawned(i) ->> IsPlayerSpawned[i]
Reply
#8

Quote:
Originally Posted by Jakku
Посмотреть сообщение
This is where it fails.

IsPlayerSpawned(i) ->> IsPlayerSpawned[i]
so what would i place there?
Reply
#9

pawn Код:
// change this line
if(IsPlayerConnected(i) && IsPlayerSpawned(i))
// too this
if(IsPlayerConnected(i) && IsPlayerSpawned[i])
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)