Whenever i compile my script the compiler crashes but still puts it into a .amx so i tried running it and it said error 17 and something about a P-Code, Here's my full script
Код:
new salelegy1;
#include <a_samp>
#include <dini>
#if defined FILTERSCRIPT
#define Shadow_Wheel 1073
#define Mega_Wheel 1074
#define Rimshine_Wheel 1075
#define Wires_Wheel 1076
#define Classic_Wheel 1077
#define Twist_Wheel 1078
#define Cutter_Wheel 1079
#define Switch_Wheel 1080
#define Grove_Wheel 1081
#define Import_Wheel 1082
#define Dollar_Wheel 1083
#define Trance_Wheel 1084
#define Atomic_Wheel 1085
#define Ahab_Wheel 1096
#define Virtual_Wheel 1097
#define Access_Wheel 1098
#define DIALOG_REGISTER1 0
#define DIALOG_REGISTER2 1
#define DIALOG_REGISTER3 2
#define DIALOG_REGISTER4 3
#define DIALOG_LOGIN1 4
#define DIALOG_NOPASS1 5
#define DIALOG_NOPASS2 6
#define DIALOG_WRONGPASS 7
#define RESPAWNTIME 600000 //Vehicle Respawn Time
enum Info
{
Sex, //0 Male 1 Female
Age, // Age
Logged, // Is the Player Logged
}
new pInfo[MAX_PLAYERS][Info];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Salmanella Drift");
AddPlayerClass(181, -2199.9331,309.2856,35.1172,359.0095, 0, 0, 0, 0, 0, 0);
AddPlayerClass(29, -2199.9331,309.2856,35.1172,359.0095, 0, 0, 0, 0, 0, 0);
AddPlayerClass(23, -2199.9331,309.2856,35.1172,359.0095, 0, 0, 0, 0, 0, 0);
AddPlayerClass(60, -2199.9331,309.2856,35.1172,359.0095, 0, 0, 0, 0, 0, 0);
AddPlayerClass(98, -2199.9331,309.2856,35.1172,359.0095, 0, 0, 0, 0, 0, 0);
AddPlayerClass(166, -2199.9331,309.2856,35.1172,359.0095, 0, 0, 0, 0, 0, 0);
AddPlayerClass(170, -2199.9331,309.2856,35.1172,359.0095, 0, 0, 0, 0, 0, 0);
salelegy1 = AddStaticVehicleEx(562,-2133.0320,210.7332,35.5365,97.3819, 0, 0, 600000);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, -2199.9331,309.2856,35.1172 );
return 1;
}
public OnPlayerConnect(playerid)
{
new pName[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pName, sizeof(pName);
format(path, sizeof(path), "/Users/%s.ini", pName);
if(!dini_Exists(path))
{
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Please Register", "Your Password:", "Proceed", "Cancel");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Your Password", "Proceed", "Cancel");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pName[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pName, sizeof(pName);
format(path, sizeof(path), "/Users/%s.ini", pName);
dini_IntSet(path, "Sex", pInfo[playerid][Sex]);
dini_IntSet(path, "Age", pInfo[playerid][Age]);
pInfo[playerid][logged] = 0;
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[])
{
new cmd[128];
new PName[24];
if(strcmp(cmd, "/mycar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0xAFAFAFAA, "You must be on foot!");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerName(playerid, PName, sizeof(PName));
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid, ploca);
plocx += (5 * floatsin(-ploca, degrees));
plocy += (5 * floatcos(-ploca, degrees));
if(strfind(PName, "Sal", true) != -1)
{
SetVehiclePos(salelegy1, plocx, plocy, plocz);
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, "You have not been given a Reserved Car");
}
}
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new PName[24];//
GetPlayerName(playerid, PName, sizeof(PName);
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleID = GetPlayerVehicleID(playerid);
if(vehicleID == salelegy1)
{
if(strcmp(PName,"Sal",true))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAFAFAFAA, "This Elegy is Reserved for Sal");
}
}
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
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[])
{
new pName[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pName, sizeof(pName);
format(path, sizeof(path), "/Users/%s.ini", pName);
switch(dialogid)
{
case DIALOG_REGISTER1:
{
if(!response)
{
Kick(playerid);
}
else
{
new passlength = strlen(inputtext)
if(passlength > 6)
{
dini_Create(path); /i
dini_Set(path, "Password", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER2, DIALOG_STYLE_LIST, "Male\r\Female", "Ok", "Cancel");
}
else
{
ShowPlayerDialog(playerid, DIALOG_NOPASS1, DIALOG_STYLE_MSGBOX, "Register", "You Have To Enter a Password!", "Ok" "Cancel");
}
}
}
case DIALOG_REGISTER2:
{
if(!response)
{
dini_Remove(path);
Kick(playerid);
}
else
{
dini_IntSet(path, "Sex", listitem);
ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Register", "Your Age?", "Ok", "Cancel");
}
}
case DIALOG_REGISTER3:
}
if(!response)
{
dini_Remove(path);
Kick(playerid);
}
else
{
dini_Set(path, "Age", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_MSGBOX, "Register", "You Have Registered!", "Ok", "OK");
}
}
case DIALOG_REGISTER4:
{
pInfo[playerid][Sex] = dini_Int(path, "Sex");
pInfo[playerid][Age] = dini_Int(path, "Age");
pInfo[playerid][Logged] = 1;
}
case DIALOG_LOGIN1:
{
if(!response)
{
Kick(playerid);
}
else
{
new passlength = strlen(inputtext);
if(passlength > 6)
{
new pass[200];
format(pass, sizeof)pass), "%s", dini_Get(path, "Password");
if(strcmp(inputtext, pass) == 0
{
pInfo[playerid][Sex] = dini_Set(path, "Sex");
pInfo[playerid][Age] = dini_Int(path, "Age");
pInfo[playerid][Logged] = 1;
}
else
{
ShowPlayerDialog(playerid, DIALOG_WRONGPASS, DIALOG_STYLE_MSGBOX, "Login", "Wrong Password!", "OK", "Cancel");
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_NOPASS2, DIALOG_STYLE_MSGBOX, "Login", "You Have To Enter a Password!", "Ok", "Cancel");
}
}
}
case DIALOG_NOPASS1:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Register", "Your Password", "Ok", "Cancel");
}
}
case DIALOG_NOPASS2:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Your Password:", "OK", "Cancel");
}
}
case DIALOG_WRONGPASS:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Your Password:", "Ok", "Cancel");
}
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}