Empty statement
#1

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if( newkeys == KEY_HORN )
{
if(IsPlayerInRangeOfPoint(playerid, 20.0 , 1477.21, 1750.11, 9.29))
{
{

if(GetPVarInt(playerid, "liftas") == 0) 
{
MoveDynamicObject(liftas, 1480.31, 1746.09, 96.01, 5.0);
SetPVarInt(playerid, "liftas", 1); 
GameTextForPlayer(playerid, "~G~ Keliates Aukstyn!", 2000, 5);
}
if(IsPlayerInRangeOfPoint(playerid, 20.0 , 1480.31, 1746.09, 96.01));
else if(GetPVarInt(playerid, "liftas") == 1) 
{
MoveDynamicObject(liftas, 1481.07, 1744.07, 9.35, 5.0);
SetPVarInt(playerid, "liftas", 0); 
GameTextForPlayer(playerid, "~R~ Keliates zemyn!", 2000, 5);
}
Error: C:\Users\Lauryno\Desktop\Servas\filterscripts\obje ktai.pwn(203) : error 036: empty statement
Reply
#2

this
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if( newkeys == KEY_HORN )
{
if(IsPlayerInRangeOfPoint(playerid, 20.0 , 1477.21, 1750.11, 9.29))
{


if(GetPVarInt(playerid, "liftas") == 0)
{
MoveDynamicObject(liftas, 1480.31, 1746.09, 96.01, 5.0);
SetPVarInt(playerid, "liftas", 1);
GameTextForPlayer(playerid, "~G~ Keliates Aukstyn!", 2000, 5);
}
if(IsPlayerInRangeOfPoint(playerid, 20.0 , 1480.31, 1746.09, 96.01));
else if(GetPVarInt(playerid, "liftas") == 1)
{
MoveDynamicObject(liftas, 1481.07, 1744.07, 9.35, 5.0);
SetPVarInt(playerid, "liftas", 0);
GameTextForPlayer(playerid, "~R~ Keliates zemyn!", 2000, 5);
}
Reply
#3

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if( newkeys == KEY_HORN )
    {
        if(IsPlayerInRangeOfPoint(playerid, 20.0 , 1477.21, 1750.11, 9.29))
        {
            if(GetPVarInt(playerid, "liftas") == 0)
            {
                MoveDynamicObject(liftas, 1480.31, 1746.09, 96.01, 5.0);
                SetPVarInt(playerid, "liftas", 1);
                GameTextForPlayer(playerid, "~G~ Keliates Aukstyn!", 2000, 5);
            }
            else if(GetPVarInt(playerid, "liftas") == 1)
            {
                MoveDynamicObject(liftas, 1481.07, 1744.07, 9.35, 5.0);
                SetPVarInt(playerid, "liftas", 0);
                GameTextForPlayer(playerid, "~R~ Keliates zemyn!", 2000, 5);
            }
        }
    }
    return 1;
}
Reply
#4

Why do you people insist on posting the whole code, without even telling what was actually wrong? Just give the guy the answer he's looking for so he can fix this (very minor) mistake himself. You don't learn anything from being served on a golden platter.
Reply
#5

Ryder, still get errors, tyler, you just removed error line..
Reply
#6

If this what you want.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if( newkeys == KEY_HORN )
    {
        if(IsPlayerInRangeOfPoint(playerid, 20.0 , 1477.21, 1750.11, 9.29))
        {
            if(GetPVarInt(playerid, "liftas") == 0)
            {
                MoveDynamicObject(liftas, 1480.31, 1746.09, 96.01, 5.0);
                SetPVarInt(playerid, "liftas", 1);
                GameTextForPlayer(playerid, "~G~ Keliates Aukstyn!", 2000, 5);
            }
        }
        if(IsPlayerInRangeOfPoint(playerid, 20.0 , 1480.31, 1746.09, 96.01))
        {
            if(GetPVarInt(playerid, "liftas") == 1)
            {
                MoveDynamicObject(liftas, 1481.07, 1744.07, 9.35, 5.0);
                SetPVarInt(playerid, "liftas", 0);
                GameTextForPlayer(playerid, "~R~ Keliates zemyn!", 2000, 5);
            }
        }
    }
    // rest
The errors means that you have an if statement which is empty. You need to open a bracket, write some part of code in it and close the bracket.
Reply
#7

Dwane thanks, works perfect!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)