checkpoints
#1

Hi im still learning and prob made a stupid mistake but hey ho i need to learn.

ok i was making some checkpoints and got some errors

pawn Код:
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(10) : error 017: undefined symbol "playerid"
C:\Users\iphone\Desktop\Our Server\Raven'
s Roleplay 0.3D\filterscripts\onpc.pwn(11) : error 017: undefined symbol "playerid"
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(12) : error 017: undefined symbol "playerid"
C:\Users\iphone\Desktop\Our Server\Raven'
s Roleplay 0.3D\filterscripts\onpc.pwn(13) : error 017: undefined symbol "playerid"
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(14) : error 017: undefined symbol "playerid"
C:\Users\iphone\Desktop\Our Server\Raven'
s Roleplay 0.3D\filterscripts\onpc.pwn(15) : warning 217: loose indentation
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(14) : warning 204: symbol is assigned a value that is never used: "bank"
C:\Users\iphone\Desktop\Our Server\Raven'
s Roleplay 0.3D\filterscripts\onpc.pwn(13) : warning 204: symbol is assigned a value that is never used: "pd"
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(12) : warning 204: symbol is assigned a value that is never used: "fce"
C:\Users\iphone\Desktop\Our Server\Raven'
s Roleplay 0.3D\filterscripts\onpc.pwn(11) : warning 204: symbol is assigned a value that is never used: "gym"
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(10) : warning 204: symbol is assigned a value that is never used: "fcweps"
C:\Users\iphone\Desktop\Our Server\Raven'
s Roleplay 0.3D\filterscripts\onpc.pwn(75) : warning 217: loose indentation
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(78) : warning 217: loose indentation
C:\Users\iphone\Desktop\Our Server\Raven'
s Roleplay 0.3D\filterscripts\onpc.pwn(79) : warning 217: loose indentation
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(85) : warning 217: loose indentation
C:\Users\iphone\Desktop\Our Server\Raven'
s Roleplay 0.3D\filterscripts\onpc.pwn(91) : warning 217: loose indentation
C:\Users\iphone\Desktop\Our Server\Raven's Roleplay 0.3D\filterscripts\onpc.pwn(247) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright © 1997-2006, ITB CompuPhase


5 Errors.
pawn Код:
#define FILTERSCRIPT
#define DIALOG 1

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
new fcweps = SetPlayerCheckpoint(playerid, -1027.8282,1063.2379,1343.7577, 5);
new gym = SetPlayerCheckpoint(playerid, -2270.4475,-155.8073,35.3203, 3);
new fce = SetPlayerCheckpoint(playerid, -2110.1394,-443.5726,38.7344, 5);
new pd = SetPlayerCheckpoint(playerid, -1615.5452,686.6962,7.1875,117.1339, 4);
new bank = SetPlayerCheckpoint(playerid, -1493.4523,920.0541,7.1875,90.1870, 5);
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}


public OnPlayerConnect(playerid)
{

    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)
    {
        GameTextForPlayer(playerid, "50 health", 900000000000000000000000000000000000000, 1);
        SetPlayerHealth(playerid, 50);
        GivePlayerWeapon(playerid, 41, 1000);
        SetPlayerPos(playerid, -1129.7382,1057.8467,1346.4141);
        SetPlayerInterior(playerid, 10);
        SetPlayerWantedLevel(playerid, 6);
        return 1;
  }
        if (strcmp("/kill", cmdtext, true, 10) == 0)
        {
            SetPlayerHealth(playerid, 0);
new name[128], stg[128];
    GetPlayerName(playerid, name, sizeof(name));

    format(stg, sizeof(stg), "%s has died using /kill.", name);
    SendClientMessageToAll(-1, stg);
    return 1;
 }
 if (strcmp("/back", cmdtext, true, 10) == 0)
        {
  SetPlayerPos(playerid, -2269.4578,-155.9560,35.3203);
  SetPlayerInterior(playerid, 0);
  return 1;
  }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    ShowPlayerDialog(playerid, DIALOG, DIALOG_STYLE_LIST, "wepons", "minigun\nm4\nak47", "ok", "cancel");
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 1:// Our dialog!
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                    GivePlayerWeapon(playerid, 38, 1000);
                }
                case 1: // The second item listed
                {
                    GivePlayerWeapon(playerid, 31, 1000);
                }
                case 2: // The third item listed
                {
                    GivePlayerWeapon(playerid, 30, 1000);
                }
            }
         }
    }
    }
   
    return 1;
    }
#endif
after you have helped me with fixing these erros could u answer a question for me ?

if i have OnPlayerEnterCheckpoint what do i do to something for each checkpoint if u know what i mean like giving it an id?
Reply
#2

sorry for double post but before i tried with more checkpoints it was fine as soon as i did that i have one BIG MOSSIVE checkpoint on my bank lol
Reply
#3

Use this one now.

pawn Код:
#define FILTERSCRIPT
#define DIALOG 1

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    // Your codes are added to OnPlayerSpawn callback.
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}


public OnPlayerConnect(playerid)
{

    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new fcweps = SetPlayerCheckpoint(playerid, -1027.8282,1063.2379,1343.7577, 5);
    new gym = SetPlayerCheckpoint(playerid, -2270.4475,-155.8073,35.3203, 3);
    new fce = SetPlayerCheckpoint(playerid, -2110.1394,-443.5726,38.7344, 5);
    new pd = SetPlayerCheckpoint(playerid, -1615.5452,686.6962,7.1875,117.1339, 4);
    new bank = SetPlayerCheckpoint(playerid, -1493.4523,920.0541,7.1875,90.1870, 5);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)
    {
        GameTextForPlayer(playerid, "50 health", 900000000000000000000000000000000000000, 1);
        SetPlayerHealth(playerid, 50);
        GivePlayerWeapon(playerid, 41, 1000);
        SetPlayerPos(playerid, -1129.7382,1057.8467,1346.4141);
        SetPlayerInterior(playerid, 10);
        SetPlayerWantedLevel(playerid, 6);
        return 1;
  }
        if (strcmp("/kill", cmdtext, true, 10) == 0)
        {
            SetPlayerHealth(playerid, 0);
new name[128], stg[128];
    GetPlayerName(playerid, name, sizeof(name));

    format(stg, sizeof(stg), "%s has died using /kill.", name);
    SendClientMessageToAll(-1, stg);
    return 1;
 }
 if (strcmp("/back", cmdtext, true, 10) == 0)
        {
  SetPlayerPos(playerid, -2269.4578,-155.9560,35.3203);
  SetPlayerInterior(playerid, 0);
  return 1;
  }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    ShowPlayerDialog(playerid, DIALOG, DIALOG_STYLE_LIST, "wepons", "minigun\nm4\nak47", "ok", "cancel");
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 1:// Our dialog!
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                    GivePlayerWeapon(playerid, 38, 1000);
                }
                case 1: // The second item listed
                {
                    GivePlayerWeapon(playerid, 31, 1000);
                }
                case 2: // The third item listed
                {
                    GivePlayerWeapon(playerid, 30, 1000);
                }
            }
         }
    }
    }
   
    return 1;
    }
#endif
Reply
#4

thanks +reped and how can i make different things for each checkpoint?

edit: would i have to use cases? like

case 0: // this is the first checkpoint

etc?
Reply
#5

@Ballu Miaa: That won't work. That's why you need streamers.

(EDIT: It won't work because SetPlayerCheckpoint only shows one checkpoint at a time. You can read more about it on the wiki)

For example:
pawn Код:
#include <a_samp>
#include <streamer>

new Float:Coordinates[][3] = {
    {-1027.8282,1063.2379,1343.7577},
    {-2270.4475,-155.8073,35.320}
};
new CPType[sizeof(Coordinates)];

public OnGameModeInit() {
    for(new x=0; x<sizeof(Coordinates); x++) {
        CPType[x] = CreateDynamicCP(Coordinates[x][0],Coordinates[x][0],Coordinates[x][0],1.0);
    }
}

public OnPlayerEnterDynamicCP(playerid, checkpointid) {
    if(checkpointid == CPType[0]) {
        // Do something here.
    }
}
Again this is just an example. You can figure it out yourself using the example.
Reply
#6

just used the code got this :/
removed

oh ok i get it now thanks
Reply
#7

Ohh yeah i forgot he would not have a CP streamer. Ma bad. Btw Thanks for the rep thefatshzms
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)