SA-MP Forums Archive
Dont read this post - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dont read this post (/showthread.php?tid=90914)



Dont read this post - ThePS3Guy - 11.08.2009

Here is the piece of script that contains the errors

http://pawno.pastebin.com/d68836762

here are the errors:

Код:
C:\Documents and Settings\Administrator\Desktop\SAMP\sampserver\gamemodes\Sky'sStunts'nStuff.pwn(718) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administrator\Desktop\SAMP\sampserver\gamemodes\Sky'sStunts'nStuff.pwn(720) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Administrator\Desktop\SAMP\sampserver\gamemodes\Sky'sStunts'nStuff.pwn(722) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
The script is suppost to a: reset the players weapons if he is not in the designated area, this works fine
b: explode their hydra/tank/hunter if they are out of the designated area, this is the part with the errors

PS: at the top under gamemodeinit i have : SetTimer("WeaponsVehicleCheck", 5000, 1); which works


Re: Please help me solve these 2 errors on a small piece of script - Abernethy - 11.08.2009

Change forward & public WeaponsVehicleCheck to
pawn Код:
forward WeaponsVehicleCheck(playerid, vehicleid);
public WeaponsVehicleCheck(playerid, vehicleid)
{ //etc..



Re: Please help me solve these 2 errors on a small piece of script - ThePS3Guy - 11.08.2009

Thanks Abernethy that got rid of the other two errors, but caused 2 more:

Код:
C:\Documents and Settings\Administrator\Desktop\SAMP\sampserver\gamemodes\Sky'sStunts'nStuff.pwn(720) : warning 206: redundant test: constant expression is non-zero
C:\Documents and Settings\Administrator\Desktop\SAMP\sampserver\gamemodes\Sky'sStunts'nStuff.pwn(722) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.



Re: Please help me solve these 2 errors on a small piece of script - Backwardsman97 - 11.08.2009

That won't fix it. Change this part.

pawn Код:
if(IsPlayerInAnyVehicle(i))
{
    new veh = GetPlayerVehicleID(i);
    if(GetVehicleModel(veh) == 432, 425, 520)//Don't think this is proper syntax
    {
        SetVehicleHealth(veh,0);
    }
}



Re: Please help me solve these 2 errors on a small piece of script - snoob - 11.08.2009

Quote:
Originally Posted by ThePS3Guy
Here is the piece of script that contains the errors

http://pawno.pastebin.com/d68836762

here are the errors:

Код:
C:\Documents and Settings\Administrator\Desktop\SAMP\sampserver\gamemodes\Sky'sStunts'nStuff.pwn(718) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administrator\Desktop\SAMP\sampserver\gamemodes\Sky'sStunts'nStuff.pwn(720) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Administrator\Desktop\SAMP\sampserver\gamemodes\Sky'sStunts'nStuff.pwn(722) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
The script is suppost to a: reset the players weapons if he is not in the designated area, this works fine
b: explode their hydra/tank/hunter if they are out of the designated area, this is the part with the errors

PS: at the top under gamemodeinit i have : SetTimer("WeaponsVehicleCheck", 5000, 1); which works
Код:
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
	new Float:X, Float:Y, Float:Z;
	GetPlayerPos(playerid, X, Y, Z);
	if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
	return 0;
}

forward WeaponsVehicleCheck();
public WeaponsVehicleCheck()
{
	for(new i; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(!IsPlayerInArea(i,423.9233, 56.4679, 2138.4824, 1681.4557))
			{
				if(IsPlayerInAnyVehicle(i))
				{
					new CarID = GetPlayerVehicleID(i);
					if(GetVehicleModel(CarID) == 432 || 425 || 520)
					{
						SetVehicleHealth(CarID,0.0);
					}
				}
				ResetPlayerWeapons(i);
			}
		}
	}
}



Re: Please help me solve these 2 errors on a small piece of script - ThePS3Guy - 11.08.2009

Thanks to both of u that solved my problem

thanks again


Re: Please help me solve these 2 errors on a small piece of script - ThePS3Guy - 11.08.2009

Wait a second now I have a new problem. It for some reason destroys all vehicles I enter instead of just rhinos hydras and hunters. I cant understand why... here is the paste bin again

http://samp.pastebin.com/m2564cfd9


Re: Please help me solve these 2 errors on a small piece of script - coole210 - 11.08.2009

This is what i use if players enter wrong car for their job. This will make it so they do NOT enter AND it sends a message, very useful.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 520)
    {
    if(ispassenger)
        {
        return 1;
        }
    else
    {
        SendClientMessage(playerid, c_r, "[ ! ] Nobody can enter these vehicles !");
        GetPlayerPos(playerid,Float:LocX,Float:LocY,Float:LocZ);
        SetPlayerPos(playerid,Float:LocX,Float:LocY,Float:LocZ);
        return 1;
        }
    }
    return 1;
}



Re: [new problem] Please help me solve these 2 errors on a small piece of script - ThePS3Guy - 11.08.2009

thanks coole could be useful! unfourtunately my problem still persists though. might use ur code somewhere else though thanks