Dont read this post
#1

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
Reply
#2

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

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

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

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

Thanks to both of u that solved my problem

thanks again
Reply
#7

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
Reply
#8

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)