Help making an include
#2

Quote:
Originally Posted by gamer931215
Посмотреть сообщение
Hi guys, i want to make my first include, its nothing special and could be integrated in the gamemode too. But i also want to learn to make includes so thats why i started something pretty simple (i thaight).

Well the problem is, i have just a few line of codes and pawno is now already crashing !
Is there anything that i should know about an include that is wrong in the following code ?

pawn Код:
#include <a_samp>
new pVehicle[MAX_VEHICLES];
new Warned[MAX_PLAYERS];

native CreatePrivateVehicle(pName,id,x,y,z,r,c1,c2);

public CreatePrivateVehicle(pName,id,x,y,z,r,c1,c2);
{
    new v = AddStaticVehicle(id,x,y,z,r,c1,c2);
    pVehicle[v] = pName;
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
        new pName[32];
        GetPlayerName(playerid,pName,sizeof pName);
        if (pName != pVehicle[GetPlayerVehicleID(playerid)]) {
            RemovePlayerFromVehicle(playerid);
            //warn player, and on 2nd time kill etc
        }
    }
    return 1;
}
Remember its not finished! only if its now already crashing, im sure im already doing something wrong so thats why i ask for help.

And also does OnPlayerStateChange work in an include, or must i made it an function that needs to be called at OnPlayerStateChange in the gamemode/filterscript ?

Anyways i couldnt find an tutorial or wiki thing for this, maybe if you can find it, you can help me with posting that link too!
Includes are just pawn code in notepad, save it as .inc
Reply


Messages In This Thread
Help making an include - by gamer931215 - 01.09.2010, 13:57
Re: Help making an include - by DaneAMattie - 01.09.2010, 14:05
Re: Help making an include - by gamer931215 - 01.09.2010, 14:06
Re: Help making an include - by gamer931215 - 01.09.2010, 14:24
Re: Help making an include - by [XST]O_x - 01.09.2010, 14:27
Re: Help making an include - by Vince - 01.09.2010, 14:39
Re: Help making an include - by gamer931215 - 01.09.2010, 17:09
Re: Help making an include - by gamer931215 - 01.09.2010, 18:10
Re: Help making an include - by LarzI - 01.09.2010, 18:16
Re: Help making an include - by gamer931215 - 02.09.2010, 11:04

Forum Jump:


Users browsing this thread: 2 Guest(s)