Jump to content

Script Aanvraag Topic


Rickyboy30

Recommended Posts

3 errors bij het compilen van de Stock zooi:

public GetDistanceBetweenPlayers(playerid,playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}

Ik krijg:

C:\Documents and Settings\gebruiker\Bureaublad\Samp server\RickServer(1).pwn(204) : error 029: invalid expression, assumed zero
C:\Documents and Settings\gebruiker\Bureaublad\Samp server\RickServer(1).pwn(204) : error 017: undefined symbol "playerid2"
C:\Documents and Settings\gebruiker\Bureaublad\Samp server\RickServer(1).pwn(209) : error 017: undefined symbol "playerid2"
C:\Documents and Settings\gebruiker\Bureaublad\Samp server\RickServer(1).pwn(215) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.

Link to comment
Delen op andere websites

  • Reacties 132
  • Created
  • Laatste reactie

Top Posters In This Topic

  • Crusher!!

    16

  • Rickyboy30

    11

  • GTAguillaume

    9

  • 1112rutger

    8

EPIC FAIL:

LimitGlobalChatRadius()

Die had ik ook al kapot lang, maar heeft nooit gewerkt :/

EDIT: Ik probeer LimitGlobalCharRadius al 3 dagen te fixen, maar hij geeft geen errors. maar heeft ook GEEN EFFECT ingame, misschien weet iemand wat het problemo is ?

Bewerkt: door Rickyboy30
Link to comment
Delen op andere websites

Hij staat hier:

AddStaticVehicle(598,622.5600,-610.6351,16.6457,268.8934,0,0); // RedCountryLVPD

AddStaticVehicle(409,1826.3666,-1682.7953,13.2597,0.7930,0,0); // Limo-Alhambra

ShowPlayerMarkers(false);

LimitGlobalChatRadius(100.0);

new id;

for (id = 0; id < 300; id++)

{

AddPlayerClass(id, 1577.2579,-2242.0542,13.5505,97.7665,50,200,0,0,0,0);

}

return 1;

}

Link to comment
Delen op andere websites

public OnPlayerText(playerid,text[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
	if(GetDistanceBetweenPlayers(playerid,i) <= MAX_DISTANCE)
	{
		// als je logs gebrukt voor chats etc.. druk dat er hier tussen...
		return true;
	}
	else
	{
		return false;
	}
}
}

stock GetDistanceBetweenPlayers(playerid,playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);

}

Deze script heb ik (boven) en deze error krijg ik (Onder).

H:\Grand Theft Auto - San Andreas\SA-MP Server 0.2\gamemodes\NL-Roleplay.pwn(477) : error 021: symbol already defined: "OnPlayerText"
H:\Grand Theft Auto - San Andreas\SA-MP Server 0.2\gamemodes\NL-Roleplay.pwn(490) : warning 209: function "OnPlayerText" should return a value
H:\Grand Theft Auto - San Andreas\SA-MP Server 0.2\gamemodes\NL-Roleplay.pwn(503) : warning 203: symbol is never used: "IsNumeric"
H:\Grand Theft Auto - San Andreas\SA-MP Server 0.2\gamemodes\NL-Roleplay.pwn(503) : warning 203: symbol is never used: "ReturnUser"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

Weet iemand wat ik fout doe?

Groeten,

Jasper

Link to comment
Delen op andere websites

Hey Jasper, Ik gebruik dit:

	if (realchat)
{
	if(!IsPlayerInAnyVehicle(playerid) || IsABike(GetPlayerVehicleID(playerid)))
	{
		format(string, sizeof(string), "%s: %s", GetPlayerNameEx(playerid), text);
		// ProxDetector(20.0 ->>...) (change the value 20.0 to your needs, ie = ProxDetector(100.0 ->>...))- changed..
		ProxDetector(100.0, playerid, string,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA);
	}
	else
	{
			if(CarWindowStatus[GetPlayerVehicleID(playerid)] == 1)
  			{
			format(string, sizeof(string), "[Windows Up] %s: %s", GetPlayerNameEx(playerid), text);
			ProxDetector(100.0, playerid, string,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA);
		}
		else
		{
			format(string, sizeof(string), "[Windows Down] %s: %s", GetPlayerNameEx(playerid), text);
			ProxDetector(100.0, playerid, string,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA);
		}
	}
	return 0;
}

en dan onderaan me script:

forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
	new Float:posx, Float:posy, Float:posz;
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	//radi = 2.0; //Trigger Radius
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(!BigEar[i])
			{
				GetPlayerPos(i, posx, posy, posz);
				tempposx = (oldposx -posx);
				tempposy = (oldposy -posy);
				tempposz = (oldposz -posz);
				//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
				if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
				{
					SendClientMessage(i, col1, string);
				}
				else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
				{
					SendClientMessage(i, col2, string);
				}
				else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
				{
					SendClientMessage(i, col3, string);
				}
				else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
				{
					SendClientMessage(i, col4, string);
				}
				else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
				{
					SendClientMessage(i, col5, string);
				}
			}
			else
			{
				SendClientMessage(i, col1, string);
			}
		}
	}
}//not connected
return 1;
}

forward ProxDetectorS(Float:radi, playerid, targetid);
public ProxDetectorS(Float:radi, playerid, targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
	new Float:posx, Float:posy, Float:posz;
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	//radi = 2.0; //Trigger Radius
	GetPlayerPos(targetid, posx, posy, posz);
	tempposx = (oldposx -posx);
	tempposy = (oldposy -posy);
	tempposz = (oldposz -posz);
	//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
	if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
	{
		return 1;
	}
}
return 0;
}

Bewerkt: door Rickyboy30
Link to comment
Delen op andere websites

Hey Jasper, Ik gebruik dit:

	if (realchat)
{
	if(!IsPlayerInAnyVehicle(playerid) || IsABike(GetPlayerVehicleID(playerid)))
	{
		format(string, sizeof(string), "%s: %s", GetPlayerNameEx(playerid), text);
		// ProxDetector(20.0 ->>...) (change the value 20.0 to your needs, ie = ProxDetector(100.0 ->>...))- changed..
		ProxDetector(100.0, playerid, string,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA);
	}
	else
	{
			if(CarWindowStatus[GetPlayerVehicleID(playerid)] == 1)
  			{
			format(string, sizeof(string), "[Windows Up] %s: %s", GetPlayerNameEx(playerid), text);
			ProxDetector(100.0, playerid, string,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA);
		}
		else
		{
			format(string, sizeof(string), "[Windows Down] %s: %s", GetPlayerNameEx(playerid), text);
			ProxDetector(100.0, playerid, string,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA,0xE0FFFFAA);
		}
	}
	return 0;
}

en dan onderaan me script:

forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
	new Float:posx, Float:posy, Float:posz;
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	//radi = 2.0; //Trigger Radius
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(!BigEar[i])
			{
				GetPlayerPos(i, posx, posy, posz);
				tempposx = (oldposx -posx);
				tempposy = (oldposy -posy);
				tempposz = (oldposz -posz);
				//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
				if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
				{
					SendClientMessage(i, col1, string);
				}
				else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
				{
					SendClientMessage(i, col2, string);
				}
				else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
				{
					SendClientMessage(i, col3, string);
				}
				else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
				{
					SendClientMessage(i, col4, string);
				}
				else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
				{
					SendClientMessage(i, col5, string);
				}
			}
			else
			{
				SendClientMessage(i, col1, string);
			}
		}
	}
}//not connected
return 1;
}

forward ProxDetectorS(Float:radi, playerid, targetid);
public ProxDetectorS(Float:radi, playerid, targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
	new Float:posx, Float:posy, Float:posz;
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	//radi = 2.0; //Trigger Radius
	GetPlayerPos(targetid, posx, posy, posz);
	tempposx = (oldposx -posx);
	tempposy = (oldposy -posy);
	tempposz = (oldposz -posz);
	//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
	if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
	{
		return 1;
	}
}
return 0;
}

Van die script snap ik dus niks van.

Link to comment
Delen op andere websites

public OnPlayerText(playerid,text[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
	if(GetDistanceBetweenPlayers(playerid,i) <= MAX_DISTANCE)
	{
		// als je logs gebrukt voor chats etc.. druk dat er hier tussen...
		return true;
	}
	else
	{
		return false;
	}
}
			return 1;
}

stock GetDistanceBetweenPlayers(playerid,playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);

}

NL-Roleplay.pwn(477) : error 021: symbol already defined: "OnPlayerText"

Je hebt nog ergens in je script OnPlayerText staan, voeg deze samen OF verwijder die andere.

NL-Roleplay.pwn(490) : warning 209: function "OnPlayerText" should return a value

fixed, als je de bovenstaande code pakt.

NL-Roleplay.pwn(503) : warning 203: symbol is never used: "IsNumeric"

Je hebt IsNumeric toegevoegd aan je script maar je gebruikt het niet, haal ut dr gewoon uit

NL-Roleplay.pwn(503) : warning 203: symbol is never used: "ReturnUser"

Zelfde als dat IsNumeric gewoon er uit halen.

Hopelijk is het zo duidelijk.

Bewerkt: door Crusher!!
Link to comment
Delen op andere websites

Een reactie plaatsen

Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.

Gast
Op dit onderwerp reageren...

×   Je hebt text geplaatst met opmaak.   Opmaak verwijderen

  Only 75 emoji are allowed.

×   Je link is automatisch ingevoegd.   In plaats daarvan weergeven als link

×   Je vorige bewerkingen zijn hersteld.   Alles verwijderen

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent actief   0 leden

    • Er zijn hier geen geregistreerde gebruikers aanwezig.

×
×
  • Create New...