pawn Код:
/*==============================================================================
DMV filterscript by Wade Martin :D
Dont remove the credits
*===============================================================================
*=============================================================================*/
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x07B1FAFF
#define COLOR_GREY 0xAFAFAFAA
#define function%0(%1) forward%0(%1); public%0(%1)
#define GivePlayerCash(%0,%1) SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
#define ResetPlayerCash(%0) SetPVarInt(%0,"Money",0), ResetPlayerMoney(%0)
#define GetPlayerCash(%0) GetPVarInt(%0,"Money")
#define SCM SendClientMessage
new dmv1;
new dmv2;
new dmv3;
new dmv4;
new dmv5;
new CP[MAX_PLAYERS];
new TakingLesson[MAX_PLAYERS];
// all you need to do is edit the filterscript with the saving system you use on your GM and it should save the DriversLic,
//remember to edit the filterscript in order for it to save in your players accounts.
// i use "enum pInfo
// pDriversLic"
//but you will need to add your own save system.
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" DMV by Sexc(Wade Martin):p");
print("--------------------------------------\n");
new playerid;
SetPlayerMapIcon(playerid, 1, 2059.206787,-1903.883056,13.243336, 36, 1);
dmv1 = AddStaticVehicle(405,2052.531494,-1903.692016,13.243583,1,1,15);
dmv2 = AddStaticVehicle(405,2055.949951,-1903.704101,13.243331,1,1,15);
dmv3 = AddStaticVehicle(405,2059.206787,-1903.883056,13.243336,1,1,15);
dmv4 = AddStaticVehicle(405,2062.361328,-1903.624877,13.243142,1,1,15);
dmv5 = AddStaticVehicle(405,2065.629150,-1903.980712,13.243326,1,1,15);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new car = GetPlayerVehicleID(playerid);
if(car == dmv1 || car == dmv2 || car == dmv3 || car == dmv4 || car == dmv5)
{
SCM(playerid, COLOR_LIGHTBLUE,"Scrie /driverslic to pentru a incepe examenul auto!");
}
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(CP[playerid]==200)
{
if(IsPlayerInVehicle(playerid, dmv1) || IsPlayerInVehicle(playerid, dmv2) || IsPlayerInVehicle(playerid, dmv3) || IsPlayerInVehicle(playerid, dmv4) || IsPlayerInVehicle(playerid, dmv5))
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 201;
SetPlayerCheckpoint(playerid, 2073.780029,-1912.620361,13.244957, 5.0);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"DMV: Nu esti in masina!");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"DMV: Nu ai trecut testul, te rugam sa incerci din nou");
DisablePlayerCheckpoint(playerid);
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
TakingLesson[playerid] = 0;
}
}
else if(CP[playerid]==201)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 202;
SetPlayerCheckpoint(playerid, 2079.123291,-1871.586303,13.048537, 5.0);
}
else if(CP[playerid]==202)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 203;
SetPlayerCheckpoint(playerid, 2079.742431,-1802.388427,13.081876, 5.0);
}
else if(CP[playerid]==203)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 204;
SetPlayerCheckpoint(playerid, 2087.171142,-1763.789306,13.093797, 5.0);
}
else if(CP[playerid]==204)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 205;
SetPlayerCheckpoint(playerid,2107.624023,-1750.020996,13.089978, 5.0);
}
else if(CP[playerid]==205)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 206;
SetPlayerCheckpoint(playerid, 2152.177490,-1750.022827,13.082652, 5.0);
}
else if(CP[playerid]==206)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 207;
SetPlayerCheckpoint(playerid, 2182.246826,-1718.454956,13.037333, 5.0);
}
else if(CP[playerid]==207)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 208;
SetPlayerCheckpoint(playerid, 2196.131347,-1639.325927,15.037650, 5.0);
}
else if(CP[playerid]==208)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 209;
SetPlayerCheckpoint(playerid, 2210.470458,-1516.888671,23.5245725, 5.0);
}
else if(CP[playerid]==209)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 210;
SetPlayerCheckpoint(playerid, 2210.367919,-1396.513427,23.513124, 5.0);
}
else if(CP[playerid]==210)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 211;
SetPlayerCheckpoint(playerid, 2189.148681,-1387.298950,23.506103, 5.0);
}
else if(CP[playerid]==211)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 212;
SetPlayerCheckpoint(playerid,2125.980468,-1386.713378,23.509986, 5.0);
}
else if(CP[playerid]==212)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 213;
SetPlayerCheckpoint(playerid, 2115.220947,-1404.61699,23.521949, 5.0);
}
else if(CP[playerid]==213)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 214;
SetPlayerCheckpoint(playerid, 2115.123779,-1505.220458,23.473100, 5.0);
}
else if(CP[playerid]==214)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 215;
SetPlayerCheckpoint(playerid,2114.831298,-1676.845214,13.123315, 5.0);
}
else if(CP[playerid]==215)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 217;
SetPlayerCheckpoint(playerid, 2098.753906,-1739.837768,13.085525, 5.0);
}
else if(CP[playerid]==217)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 218;
SetPlayerCheckpoint(playerid,2084.242431,-1822.566650,13.074979 , 5.0);
}
else if(CP[playerid]==218)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 219;
SetPlayerCheckpoint(playerid, 2084.016845,-1890.064941,13.066734, 5.0);
}
else if(CP[playerid]==219)
{
new pName[24];
new str[128];
GetPlayerName(playerid, pName, 24);
pName[strfind(pName,"_")] = ' ';
GivePlayerCash(playerid, -500);
format(str, 128,"DMV: Felicitari %s! Ai trecut testul.", pName);
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
TakingLesson[playerid] = 0;
//PlayerInfo[playerid][pDriveLic] = 1;
DisablePlayerCheckpoint(playerid);
}
else
{
DisablePlayerCheckpoint(playerid);
}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" ITS A FILTERSCRIPT");
print("----------------------------------\n");
}
#endif
CMD:driverslic(playerid, params[])
{
//if(PlayerInfo[playerid][pDriveLic] == 1) return SCM(playerid, COLOR_GREY,"You already have Driving License!");
if(IsPlayerInVehicle(playerid, dmv1) || IsPlayerInVehicle(playerid, dmv2) || IsPlayerInVehicle(playerid,dmv3) || IsPlayerInVehicle(playerid,dmv4) || IsPlayerInVehicle(playerid,dmv5))
{
TogglePlayerControllable(playerid, 1);
CP[playerid] = 200;
SetPlayerCheckpoint(playerid, 2073.780029,-1912.620361,13.244957, 4.0);
TakingLesson[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "DMV: Te rugam urmeaza checkpointurile si condu cu grija!");
}
else return SCM(playerid, COLOR_GREY,"Nu esti intr-o masina DMV");
return 1;
}