18.06.2012, 08:13
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
new jobs;
new mechanic[MAX_PLAYERS];
new taxidriver[MAX_PLAYERS];
new newser[MAX_PLAYERS];
new VISA1[MAX_PLAYERS];
new VISA2[MAX_PLAYERS];
new VISA3[MAX_PLAYERS];
new lv1;
new ls2;
new sf3;
new checkpoint[MAX_PLAYERS];
#define BLUE 0x00FFFFFF
new bool:ejectFromVeh = false;
new ScoreTimer1[MAX_PLAYERS];
new damn;
new mechanicpickup;
new taxidriverpickup;
new newserpickup;
new lvhealth;
new lshealth;
new sfhealth;
new civilianpickup;
new PlayerDeath[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
lvhealth = CreatePickup(1240,1,1582.9225,1768.5857,10.8203,-1);
lshealth = CreatePickup(1240,1,2030.0438,-1403.7098,17.2555,-1);
sfhealth = CreatePickup(1240,1,-2653.0256,639.0574,14.4531,-1);
mechanicpickup = CreatePickup(1239,1,358.2369,159.8560,1008.3828,-1);
taxidriverpickup = CreatePickup(1239,1,358.2362,162.5345,1008.3828,-1);
newserpickup = CreatePickup(1239,1,358.2361,166.3266,1008.3828,-1);
civilianpickup = CreatePickup(1239,1,358.2374,169.4623,1008.3828,-1);
lv1 = CreatePickup(1239,1,358.2370,178.9161,1008.3828,-1);
ls2 = CreatePickup(1239,1,358.2393,182.1947,1008.3828,-1);
sf3 = CreatePickup(1239,1,358.2414,185.7646,1008.3828,-1);
AddStaticVehicle(525,2813.3120,1374.9358,10.6291,359.5251,52,54); //
AddStaticVehicle(525,2810.2046,1374.6703,10.6505,2.0662,52,54); //
AddStaticVehicle(525,2805.8354,1367.6526,10.6473,87.9377,52,54); //
AddStaticVehicle(525,2805.3474,1364.9200,10.6606,90.0538,52,54); //
AddStaticVehicle(525,2804.8330,1361.9142,10.6475,92.9163,52,54); //
AddStaticVehicle(525,2804.7917,1358.1093,10.6266,85.3838,52,54); //
AddStaticVehicle(525,2805.5627,1355.2761,10.6437,87.1027,52,54); //
AddStaticVehicle(525,2804.6855,1351.0729,10.6465,91.5071,52,54); //
AddStaticVehicle(525,2805.5110,1347.9838,10.6357,90.3564,52,54); //
AddStaticVehicle(525,2804.8347,1345.1091,10.6614,89.6408,52,54); //
AddStaticVehicle(420,2246.9246,2034.7103,10.6270,269.8234,6,1); //
AddStaticVehicle(420,2246.8064,2038.6212,10.6172,269.6314,6,1); //
AddStaticVehicle(420,2246.7952,2042.5216,10.6194,270.4222,6,1); //
AddStaticVehicle(420,2246.6353,2046.7167,10.6165,269.2106,6,1); //
AddStaticVehicle(420,2247.1021,2050.3955,10.6270,269.8377,6,1); //
AddStaticVehicle(420,2284.5625,2050.3689,10.5950,268.2249,6,1); //
AddStaticVehicle(420,2284.6382,2046.6752,10.6235,269.4680,6,1); //
AddStaticVehicle(582,1024.3666,2238.2061,10.8681,87.9386,41,20); //
AddStaticVehicle(582,1024.5304,2263.5625,10.8650,90.9301,41,20); //
AddStaticVehicle(582,1024.1796,2270.2329,10.8650,88.8053,41,20); //
AddStaticVehicle(582,1024.1565,2279.7329,10.8650,88.4759,41,20); //
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
if(mechanic[playerid] =1)
{
ScoreTimer1[playerid] = SetTimerEx("AddScore1", 3600000, true, "i", playerid);
}
if(taxidriver[playerid] =1)
{
ScoreTimer1[playerid] = SetTimerEx("AddScore1", 3600000, true, "i", playerid);
}
if(newser[playerid] =1)
{
ScoreTimer1[playerid] = SetTimerEx("AddScore1", 3600000, true, "i", playerid);
mechanic[playerid]=0;
taxidriver[playerid]=0;
newser[playerid]=0;
VISA1[playerid]=0;
VISA2[playerid]=0;
VISA3[playerid]=0;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
new news;
new pickup;
new taxier;
if(checkpoint[playerid]==pickup)
{
SendClientMessage(playerid,BLUE,"You have reached at the park of job which you selected!");
}
if(checkpoint[playerid]==taxier)
{
SendClientMessage(playerid,BLUE,"You have reached at the park of job which you selected");
}
if(checkpoint[playerid]==news)
{
SendClientMessage(playerid,BLUE,"You have reached at park of job which you selected");
}
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)
{
new pickup;
new taxier;
new news;
if(pickupid == jobs)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Which job you want to take","Mechanic\n TaxiDriver\n SanAndreasNews","Select","Exit");
}
if(pickupid == damn)
{
if(mechanic[playerid] = 0) return SendClientMessage(playerid, 0xD6D6D6AA, "You donot receive the wage, because you are not doing this job");
{
if(mechanic[playerid] == 1)
{
GivePlayerMoney(playerid, 500);
SendClientMessage(playerid, 0xD6D6D6, "You received the wage from the manager");
}
if(taxidriver[playerid] == 0) return SendClientMessage(playerid, 0xD6D6D6AA, "You donot receive the wage, because you are not doing this job");
{
if(taxidriver[playerid] == 1)
{
GivePlayerMoney(playerid, 500);
SendClientMessage(playerid, 0xD6D6D6, "You received the wage from the manager");
}
if(newser[playerid] == 0) return SendClientMessage(playerid, 0xD6D6D6AA, "You donot receive the wage, because you are not doing this job");
{
if(newser[playerid] == 1)
{
GivePlayerMoney(playerid, 500);
SendClientMessage(playerid, 0xD6D6D6, "You received the wage from the manager");
}
}
}
}
}
if(pickupid == pickup)
{
SendClientMessage(playerid,BLUE,"You have reached at the park of job which you selected!");
}
if(pickupid == taxier)
{
SendClientMessage(playerid,BLUE,"You have reached at the park of job which you selected");
}
if(pickupid == news)
{
SendClientMessage(playerid,BLUE,"You have reached at park of job which you selected");
}
if(pickupid == taxidriverpickup)
{
if(mechanic[playerid] == 1) return SendClientMessage(playerid,0xD6D6D6AA,"You already taken a job");
{
if(newser[playerid] == 1) return SendClientMessage(playerid,0xD6D6D6AA,"You already taken a job");
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Mechanic","Congratulations, you have been taken the Taxi job, go to the taxi park now","Ok");
SendClientMessage(playerid, 0xD6D6D6AA,"Congratulations, you have been taken the Taxi job, go to the taxi park now");
taxier = SetPlayerCheckpoint(playerid,2262.2725,2035.8972,10.8203,1.5);
taxier = CreatePickup(1239,1,2262.2725,2035.8972,10.8203,-1);
taxidriver[playerid] = 1;
}
if(pickupid == mechanicpickup)
{
if(newser[playerid] == 1) return SendClientMessage(playerid,0xD6D6D6AA,"You already taken a job");
{
if(taxidriver[playerid] == 1) return SendClientMessage(playerid,0xD6D6D6AA,"You already taken a job");
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Mechanic","Congratulations, you have been taken the mechanic job, go to the mechanic park now","Ok");
SendClientMessage(playerid, 0xD6D6D6AA, "Congratulations");
pickup = SetPlayerCheckpoint(playerid,2820.6321,1367.2216,10.7500,1.5);
pickup = CreatePickup(1239,1,2820.6321,1367.2216,10.7500,-1);
mechanic[playerid] = 1;
}
if(pickupid == newserpickup)
{
if(mechanic[playerid] == 1) return SendClientMessage(playerid,0xD6D6D6AA,"You already taken a job");
{
if(taxidriver[playerid] == 1) return SendClientMessage(playerid,0xD6D6D6AA,"You already taken a job");
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Mechanic","Congratulations, you have been taken the bus job, go to the News park now","Ok");
SendClientMessage(playerid, 0xD6D6D6AA, "Congratulations, you have been taken the SanAndreasNews job, go to the News park now");
newser[playerid] = 1;
news = CreatePickup(1239,0,0,0,-1);
news = SetPlayerCheckpoint(playerid,0,0,0,1.5);
}
if(pickupid == lv1)
{
ShowPlayerDialog(playerid,1238,DIALOG_STYLE_MSGBOX,"Congratulations","You have purchased the visa of LV","Ok");
VISA1[playerid] = 1;
}
if(pickupid == ls2)
{
ShowPlayerDialog(playerid,1238,DIALOG_STYLE_MSGBOX,"Congratulations","You have purchased the visa of LS","Ok");
VISA2[playerid] = 1;
}
if(pickupid == sf3)
{
ShowPlayerDialog(playerid,1238,DIALOG_STYLE_MSGBOX,"Congratulations","You have purchased the visa of SF","Ok");
VISA3[playerid] = 1;
}
if(pickupid == lvhealth)
{
SetPlayerHealth(playerid, 100);
}
if(pickupid == lshealth)
{
SetPlayerHealth(playerid, 100);
}
if(pickupid == sfhealth)
{
SetPlayerHealth(playerid, 100);
}
if(pickupid == civilianpickup)
{
mechanic[playerid] = 0;
taxidriver[playerid] = 0;
newser[playerid] = 0;
}
}
}
}
}
}
}
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[])
{
new taxier;
new news;
new pickup;
if(dialogid==1 && response==1)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Mechanic","Congratulations, you have been taken the mechanic job, go to the mechanic park now");
SendClientMessage(playerid, 0xD6D6D6AA, "Congratulations");
pickup = SetPlayerCheckpoint(playerid,2820.6321,1367.2216,10.7500,1.5);
pickup = CreatePickup(1239,1,2820.6321,1367.2216,10.7500,-1);
mechanic[playerid] = 1;
}
case 1:
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Mechanic","Congratulations, you have been taken the Taxi job, go to the taxi park now");
SendClientMessage(playerid, 0xD6D6D6AA,"Congratulations, you have been taken the Taxi job, go to the taxi park now");
taxier = SetPlayerCheckpoint(playerid,2262.2725,2035.8972,10.8203,1.5);
taxier = CreatePickup(1239,1,2262.2725,2035.8972,10.8203,-1);
taxidriver[playerid] = 1;
}
case 2:
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Mechanic","Congratulations, you have been taken the bus job, go to the News park now");
SendClientMessage(playerid, 0xD6D6D6AA, "Congratulations, you have been taken the bus job, go to the bus park now");
newser[playerid] = 1;
news = CreatePickup(1239,0,0,0,-1);
news = SetPlayerCheckpoint(playerid,0,0,0,1.5);
}
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new mechanic[MAX_PLAYERS];
if(strcmp(cmdtext, "/repair", true) == 0)
{
if(mechanic[playerid] == 1)
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
SendClientMessage(playerid,0xD6D6D6AA,"Sir!, The Vehicle has been repaired, and Your moneys have been -500");
GivePlayerMoney(playerid, -500);
}
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == 420)
{
if(taxidriver[playerid] = 0)
{
SendClientMessage(playerid, 0xD6D6D6AA, "You cant drive this car");
ejectFromVeh = true;
}
}
if(vehicleid == 525)
{
if(mechanic[playerid] = 0)
{
SendClientMessage(playerid, 0xD6D6D6AA, "You cant drive this car");
ejectFromVeh = true;
}
}
if(vehicleid == 582)
{
if(newser[playerid] = 0)
{
SendClientMessage(playerid, 0xD6D6D6AA, "You cant drive this car");
ejectFromVeh = true;
}
}
return 1;
}
forward AddScore1(playerid);
public AddScore1(playerid)
{
if(mechanic[playerid] = 1)
{
SendClientMessage(playerid, 0xD6D6D6AA, "Go to the city hall, and then go to the manager office to take the wage");
damn = CreatePickup(1239,1,362.4671,173.6203,1008.3828,-1);
KillTimer(ScoreTimer1[playerid]);
}
if(taxidriver[playerid] = 1)
{
SendClientMessage(playerid, 0xD6D6D6AA, "Go to the city hall, and then go to the manager office to take the wage");
damn = CreatePickup(1239,1,362.4671,173.6203,1008.3828,-1);
KillTimer(ScoreTimer1[playerid]);
}
if(newser[playerid] = 1)
{
SendClientMessage(playerid, 0xD6D6D6AA, "Go to the city hall, and then go to the manager office to take the wage");
damn = CreatePickup(1239,1,362.4671,173.6203,1008.3828,-1);
KillTimer(ScoreTimer1[playerid]);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(PlayerDeath[playerid] == 1)
{
if(VISA1[playerid] == 1)
{
SetPlayerPos(playerid,1582.9225,1768.5857,10.8203);
}
if(VISA2[playerid] == 1)
{
SetPlayerPos(playerid,2030.0438,-1403.7098,17.2555);
}
if(VISA3[playerid] == 1)
{
SetPlayerPos(playerid,-2653.0256,639.0574,14.4531);
PlayerDeath[playerid] = 0;
}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerDeath[playerid] = 1;
return 1;
}
I don't get the dialog even, even no messages which i wrote, fix it please copy it and paste it in your pawno then compile it and then fix the bugs and warnings