01.09.2010, 13:57
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 ?
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!
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;
}
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!