Function or Declaration
#1

I need help on this ;/ Couldnt find a way how to fix them now asking for help ;/
Код:
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11126) : error 010: invalid function or declaration
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11128) : error 010: invalid function or declaration
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11132) : error 010: invalid function or declaration
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11141) : error 010: invalid function or declaration
Код:
CMD:dropcar(playerid)
{
    if(GetPlayerVehicleID(playerid) != 0)
    {
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, 2505.8506, -2629.0144, 13.2944, 5); 
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Drop the car at the crane!");
        dropping[playerid] = true;
    }
    return 1;
}
11126 if(IsPlayerInCheckpoint(playerid) !=0)
{
11128    if(dropping[playerid] == true)
    {
        DisablePlayerCheckpoint(playerid);
        stock str[128];
11132        price = 100;
		{
	    format(str, sizeof(str), "*You've earned {FF6347}$%d{33CCFF} from dropping a car!", price);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
        GivePlayerMoney(playerid, price);
        dropping[playerid] = false;
        SetTimerEx("DropTimer", 20000, false, "i", playerid);
        }
    }
11141    return 1;
}
Reply
#2

You can't use those like that. You ended the command by returning 1, and then you're calling those functions outside of all callbacks, so it wouldn't work.
Reply
#3

How may i fix it then ? By makeing the first "return 1" to "return 0" ?
Reply
#4

Maybe use this?
pawn Код:
CMD:dropcar(playerid)
{
    if(GetPlayerVehicleID(playerid) != 0)
    {
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, 2505.8506, -2629.0144, 13.2944, 5);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Drop the car at the crane!");
        dropping[playerid] = true;
    }
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
        if(dropping[playerid] == true)
        {
            DisablePlayerCheckpoint(playerid);
            stock str[128];
            price = 100;
            format(str, sizeof(str), "*You've earned {FF6347}$%d{33CCFF} from dropping a car!", price);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
            GivePlayerMoney(playerid, price);
            dropping[playerid] = false;
            SetTimerEx("DropTimer", 20000, false, "i", playerid);
        }
        return 1;
}
Reply
#5

Quote:
Originally Posted by biker122
Посмотреть сообщение
Maybe use this?
pawn Код:
CMD:dropcar(playerid)
{
    if(GetPlayerVehicleID(playerid) != 0)
    {
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, 2505.8506, -2629.0144, 13.2944, 5);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Drop the car at the crane!");
        dropping[playerid] = true;
    }
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
        if(dropping[playerid] == true)
        {
            DisablePlayerCheckpoint(playerid);
            stock str[128];
            price = 100;
            format(str, sizeof(str), "*You've earned {FF6347}$%d{33CCFF} from dropping a car!", price);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
            GivePlayerMoney(playerid, price);
            dropping[playerid] = false;
            SetTimerEx("DropTimer", 20000, false, "i", playerid);
        }
        return 1;
}
Код:
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11132) : error 029: invalid expression, assumed zero
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11132) : error 017: undefined symbol "str"
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11132) : warning 215: expression has no effect
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11132) : error 001: expected token: ";", but found "]"
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(11132) : fatal error 107: too many error messages on one line
Now this ;/
Reply
#6

pawn Код:
CMD:dropcar(playerid)
{
* * if(GetPlayerVehicleID(playerid) != 0)
* * {
* * * * DisablePlayerCheckpoint(playerid);
* * * * SetPlayerCheckpoint(playerid, 2505.8506, -2629.0144, 13.2944, 5);
* * * * SendClientMessage(playerid, COLOR_LIGHTBLUE, "Drop the car at the crane!");
* * * * dropping[playerid] = true;
* * }
* * return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
* * * * if(dropping[playerid] == true)
* * * * {
* * * * * * DisablePlayerCheckpoint(playerid);
* * * * * * new str[128];
* * * * * * new price = randon(1000);
* * * * * * format(str, sizeof(str), "*You've earned {FF6347}$%d{33CCFF} from dropping a car!", price);
* * * * * * SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
* * * * * * GivePlayerMoney(playerid, price);
* * * * * * dropping[playerid] = false;
* * * * * * SetTimerEx("DropTimer", 20000, false, "i", playerid);
* * * * }
* * * * return 1;
}
Reply
#7

(23596) : error 021: symbol already defined: "Streamer_OnPlayerEnterCP"

Only this now ;/
Reply
#8

Just put the code into the existing OnPlayerEnterCheckpoint callback and delete this one.
Reply
#9

Yeah i did it before and now it works. Forgot to say thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)