SA-MP Forums Archive
Need some help ;) - 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)
+--- Thread: Need some help ;) (/showthread.php?tid=362957)



Need some help ;) - Racer99 - 26.07.2012

Am kinda new to scripting so I was trying to fix some errors I had in my script and I need some help to fix them.

Here are the errors:

C:\Users\USER\Desktop\Gamemode.pwn(239) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(239) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Gamemode.pwn(239) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Users\USER\Desktop\Gamemode.pwn(244) : warning 225: unreachable code
C:\Users\USER\Desktop\Gamemode.pwn(244) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Gamemode.pwn(244) : error 004: function "OnPlayerKeyStateChange" is not implemented
C:\Users\USER\Desktop\Gamemode.pwn(245) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(246) : error 017: undefined symbol "PRESSED"
C:\Users\USER\Desktop\Gamemode.pwn(246) : error 036: empty statement
C:\Users\USER\Desktop\Gamemode.pwn(257) : error 017: undefined symbol "newkeys"
C:\Users\USER\Desktop\Gamemode.pwn(265) : error 017: undefined symbol "newkeys"
C:\Users\USER\Desktop\Gamemode.pwn(266) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(269) : error 030: compound statement not closed at the end of file (started at line 97)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Errors.



And here is the part of the script with errors:


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{ SendClientMessage(playerid, COLOR_DARKGREY, "You have enter a vehicle! Type /tune1-3 if you want to tune a car");
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED,("KEY_SUBMISSION);
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_YELLOW,"Vehicle fixed!");
}
}
if(PRESSED(KEY_ACTION))
{
if(IsPlayerNotInVehicle(playerid))
{
SendClientMessage(playerid,COLOR_YELLOW,"You have to be in a vehicle!");
}
}

{if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && (newkeys & KEY_ACTION || newkeys & KEY_FIRE)) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
return 1;
}
}




Any help I will totally appreciate it


Re: Need some help ;) - Devilxz97 - 26.07.2012

pawn Код:
C:\Users\USER\Desktop\Gamemode.pwn(239) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(239) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Gamemode.pwn(239) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Users\USER\Desktop\Gamemode.pwn(244) : warning 225: unreachable code
C:\Users\USER\Desktop\Gamemode.pwn(244) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Gamemode.pwn(244) : error 004: function "OnPlayerKeyStateChange" is not implemented
C:\Users\USER\Desktop\Gamemode.pwn(245) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(246) : error 017: undefined symbol "PRESSED"
C:\Users\USER\Desktop\Gamemode.pwn(246) : error 036: empty statement
C:\Users\USER\Desktop\Gamemode.pwn(257) : error 017: undefined symbol "newkeys"
C:\Users\USER\Desktop\Gamemode.pwn(265) : error 017: undefined symbol "newkeys"
C:\Users\USER\Desktop\Gamemode.pwn(266) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(269) : error 030: compound statement not closed at the end of file (started at line 97)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SendClientMessage(playerid, COLOR_DARKGREY, "You have enter a vehicle! Type /tune1-3 if you want to tune a car");
    return 1;
}
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_SUBMISSION))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(IsPlayerInVehicle(playerid, vehicleid))
        {
            new VehicleID, Float:X, Float:Y, Float:Z, Float:Angle;
            GetPlayerPos(playerid, X, Y, Z);
            VehicleID = GetPlayerVehicleID(playerid);
            GetVehicleZAngle(VehicleID, Angle);
            SetVehicleZAngle(VehicleID, Angle);
            SetVehicleHealth(VehicleID,1000.0);
            AddVehicleComponent(vehicleid, 1010);
            RepairVehicle(vehicleid);
            }
        }
        if(PRESSED(KEY_ACTION))
        {
            if(IsPlayerNotInVehicle(playerid))
            {
                SendClientMessage(playerid, red, "You need to be in any Vehicle !");
            }
    }
    return 1;
}



Re: Need some help ;) - Racer99 - 26.07.2012

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
if(
PRESSED,("KEY_SUBMISSION);
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_YELLOW,"
Vehicle fixed!");
}
}
if(PRESSED(KEY_ACTION))
{
if(IsPlayerNotInVehicle(playerid))
{
SendClientMessage(playerid,COLOR_YELLOW,"
You have to be in a vehicle!");
}

This is supposed to be a fix vehicle button not a teleport button


Re: Need some help ;) - Kitten - 26.07.2012

Try
pawn Код:
if(PRESSED(KEY_SUBMISSION))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:X, Float:Y, Float:Z, Float:Angle;
            RepairVehicle ( GetPlayerVehicleID ( playerid ) );
            SetVehicleHealth ( GetPlayerVehicleID ( playerid ), 9999.0 );
            GetVehicleZAngle( GetPlayerVehicleID ( playerid ), Angle );
            SetVehicleZAngle( GetPlayerVehicleID ( playerid ), Angle );
            AddVehicleComponent( GetPlayerVehicleID ( playerid ), 1010 );
        }
        else
        {
            SendClientMessage(playerid, red, "You need to be in any Vehicle !");
        }
    }



Re: Need some help ;) - Racer99 - 26.07.2012

PHP код:
C:\Users\USER\Desktop\HELP.pwn(239) : warning 217loose indentation
C
:\Users\USER\Desktop\HELP.pwn(239) : error 029invalid expressionassumed zero
C
:\Users\USER\Desktop\HELP.pwn(239) : error 004: function "OnPlayerEnterVehicle" is not implemented
C
:\Users\USER\Desktop\HELP.pwn(245) : warning 225unreachable code
C
:\Users\USER\Desktop\HELP.pwn(245) : error 029invalid expressionassumed zero
C
:\Users\USER\Desktop\HELP.pwn(245) : error 004: function "OnPlayerKeyStateChange" is not implemented
C
:\Users\USER\Desktop\HELP.pwn(246) : warning 217loose indentation
C
:\Users\USER\Desktop\HELP.pwn(249) : warning 203symbol is never used"Z"
C:\Users\USER\Desktop\HELP.pwn(249) : warning 203symbol is never used"Y"
C:\Users\USER\Desktop\HELP.pwn(249) : warning 203symbol is never used"X"
C:\Users\USER\Desktop\HELP.pwn(262) : warning 217loose indentation
C
:\Users\USER\Desktop\HELP.pwn(262) : error 017undefined symbol "newkeys"
C:\Users\USER\Desktop\HELP.pwn(263) : warning 217loose indentation
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
5 Errors

Am getting these errors now


Re: Need some help ;) - Devilxz97 - 26.07.2012

show me the list of your include's


Re: Need some help ;) - Devilxz97 - 26.07.2012

Quote:
Originally Posted by Racer99
Посмотреть сообщение
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
if(
PRESSED,("KEY_SUBMISSION);
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_YELLOW,"
Vehicle fixed!");
}
}
if(PRESSED(KEY_ACTION))
{
if(IsPlayerNotInVehicle(playerid))
{
SendClientMessage(playerid,COLOR_YELLOW,"
You have to be in a vehicle!");
}

This is supposed to be a fix vehicle button not a teleport button
that will fix/flip/add nitrous to your vehicle directly not to teleport -,-


Re: Need some help ;) - Racer99 - 26.07.2012

oh sorry haha

My includes are:

a_http.inc a_mysql.inc a_npc.inc a_objects.inc a_players.inc a_samp.inc a_sampdb.inc
a_vehicles.inc core.inc datagram.inc file.inc float.inc foreach.inc regex.inc sscanf2.inc string.inc
time.inc zcmd.inc


Re: Need some help ;) - Alexis1999 - 26.07.2012

Quote:
Originally Posted by Racer99
Посмотреть сообщение
oh sorry haha

My includes are:

a_http.inc a_mysql.inc a_npc.inc a_objects.inc a_players.inc a_samp.inc a_sampdb.inc
a_vehicles.inc core.inc datagram.inc file.inc float.inc foreach.inc regex.inc sscanf2.inc string.inc
time.inc zcmd.inc
Add this at the top of your gamemode/filterscript

pawn Код:
#include <a_samp>



Re: Need some help ;) - Racer99 - 26.07.2012

Yes I have that

Here is the gamemode script: http://pastebin.com/xaeqx5Az