Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <streamer>
- #define NORMAL_BLITZER 90
- #define MAX_U_BLITZER 10
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- new DB:BlitzerDB;
- enum blitzeri{
- ubObject,
- ubGebiet,
- ubID,
- Float:ubX,
- Float:ubY,
- Float:ubZ,
- Float:ubAng,
- ubMaxSpeed,
- ubWinkel,
- bool:ubErstellt,
- };
- new uBlitzer[MAX_U_BLITZER][blitzeri];
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- BlitzerDB = db_open("blitzer.db");
- db_query(BlitzerDB, "CREATE TABLE IF NOT EXISTS `Blitzer` (`bID`, `bX`, `bY`, `bZ`, `bRZ`, `bMaxSpeed`, `bWinkel`)");
- LoadBlitzer();
- return 1;
- }
- stock CreateBlitzer(Float:x, Float:y, Float:z, Float:rz, MaxSpeed, Winkel = NORMAL_BLITZER)
- {
- for(new i; i < MAX_U_BLITZER; i++)
- {
- if(uBlitzer[i][ubErstellt] == false)
- {
- #if !defined BLITZER_NO_SAVE
- new string[256];
- format(string, sizeof(string), "INSERT INTO `Blitzer` (`bID`, `bX`, `bY`, `bZ`, `bRZ`, `bMaxSpeed`, `bWinkel`) VALUES ('%i', '%f', '%f', '%f', '%f', '%i', '%i')", i, x, y, z, rz, MaxSpeed, Winkel);
- db_free_result(db_query(BlitzerDB, string));
- #endif
- uBlitzer[i][ubObject] = CreateDynamicObject(18880, x, y, z-1.2, 0.0, 0.0, (rz-180));
- uBlitzer[i][ubGebiet] = CreateDynamicRectangle(x-10, y-10, x+10, y+10);
- uBlitzer[i][ubID] = i;
- uBlitzer[i][ubX] = x;
- uBlitzer[i][ubY] = y;
- uBlitzer[i][ubZ] = z;
- uBlitzer[i][ubAng] = rz;
- uBlitzer[i][ubMaxSpeed] = MaxSpeed;
- uBlitzer[i][ubWinkel] = Winkel;
- uBlitzer[i][ubErstellt] = true;
- return i;
- }
- }
- return print(">>> [Uncles Blitzer] FEHLER: Beim erstellen vom Blitzer ist ein Fehler aufgetreten. (MAX_U_BLITZER zu klein?) <<<") & 0;
- }
- stock LoadBlitzer()
- {
- new rows, buffer[24], DBResult:result, slot;
- result = db_query(BlitzerDB, "SELECT * FROM `Blitzer`");
- rows = db_num_rows(result);
- if(rows == 0) return print("* 0 Blitzer geladen *");
- for(new i; i < rows; i++)
- {
- db_get_field(result, 0, buffer, 24), slot = strval(buffer), uBlitzer[slot][ubID] = slot;
- db_get_field(result, 1, buffer, 24), uBlitzer[slot][ubX] = floatstr(buffer);
- db_get_field(result, 2, buffer, 24), uBlitzer[slot][ubY] = floatstr(buffer);
- db_get_field(result, 3, buffer, 24), uBlitzer[slot][ubZ] = floatstr(buffer);
- db_get_field(result, 4, buffer, 24), uBlitzer[slot][ubAng] = floatstr(buffer);
- db_get_field(result, 5, buffer, 24), uBlitzer[slot][ubMaxSpeed] = strval(buffer);
- db_get_field(result, 6, buffer, 24), uBlitzer[slot][ubWinkel] = strval(buffer);
- uBlitzer[slot][ubObject] = CreateDynamicObject(18880, uBlitzer[slot][ubX], uBlitzer[slot][ubY], uBlitzer[slot][ubZ]-1.2, 0.0, 0.0, (uBlitzer[slot][ubAng]-180));
- uBlitzer[slot][ubGebiet] = CreateDynamicRectangle(uBlitzer[slot][ubX]-10, uBlitzer[slot][ubY]-10, uBlitzer[slot][ubX]+10, uBlitzer[slot][ubY]+10);
- uBlitzer[slot][ubErstellt] = true;
- db_next_row(result);
- }
- db_free_result(result);
- printf("* %i Blitzer geladen *", rows);
- return 1;
- }
- public OnGameModeExit()
- {
- db_close(BlitzerDB);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- 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[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- new Float:Pos[4];
- GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
- GetPlayerFacingAngle(playerid,Pos[3]);
- CreateBlitzer(Pos[0],Pos[1],Pos[2], Pos[3], 100);
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- 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[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment