Spawn Button Deaktivieren

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • Spawn Button Deaktivieren

      Hallo Liebes Breadfish,

      da ich selber ein Script schreibe und zuzeit nicht mehr weiter weiß frage ich euch ob ihr mir helfen könnt.
      Und zwar ich möchte gerne den Spawn Button Deaktivieren aber wies nicht wie und wo daich im Bereich Scripten neu bin.Die Datenbankdaten habe ich mal weggemacht aber die Datenbank geht.


      Es wäre sehr nett von euch wen ihr mir helfen könnt.


      Vielen Dank :)

      PAWN-Quellcode

      1. //Include´s
      2. #include <a_samp>
      3. #include <a_mysql>
      4. #include <sscanf2>
      5. #include <ocmd>
      6. //Enums
      7. enum playerInfo{
      8. eingeloggt,
      9. level,
      10. pid,
      11. geld,
      12. alevel
      13. }
      14. enum buildingsEnum{
      15. Float:b_x,
      16. Float:b_y,
      17. Float:b_z,
      18. Float:b_ix,
      19. Float:b_iy,
      20. Float:b_iz,
      21. b_interior
      22. }
      23. enum hausEnum{
      24. Float:h_x,
      25. Float:h_y,
      26. Float:h_z,
      27. Float:ih_x,
      28. Float:ih_y,
      29. Float:ih_z,
      30. h_interior,
      31. h_besitzer[MAX_PLAYER_NAME],
      32. h_preis,
      33. h_id,
      34. h_pickup,
      35. Text3D:h_text
      36. }
      37. //Globale Variablen
      38. new dbhandle;
      39. new sInfo[MAX_PLAYERS][playerInfo];
      40. new Float:TelePos[MAX_PLAYERS][6];
      41. new hInfo[9000][hausEnum];
      42. new bInfo[][buildingsEnum] = {
      43. {660.6880,-573.4324,16.3359,-25.8953,-186.9506,1003.5469,17},
      44. {999.6731,-920.2469,42.3281,-26.0325,-140.4643,1003.5469,16}
      45. };
      46. //Farbe
      47. #define Gelb 0xFFFF1BFF
      48. #define Rot 0xFF0000FF
      49. #define Grün 0x41FF00FF
      50. #define Türkis 0x00C3FFFF
      51. #define Blau 0x0023FFFF
      52. //DIALOG
      53. #define DIALOG_TP 1
      54. #define DIALOG_REGISTER 2
      55. #define DIALOG_LOGIN 3
      56. //Datenbank
      57. #define db_host "****"
      58. #define db_user "***"
      59. #define db_pass "******"
      60. #define db_db "******"
      61. //Forward
      62. forward akick();
      63. forward neustart();
      64. forward OnUserCheck(playerid);
      65. forward OnPasswortCheck(playerid);
      66. forward OnPlayerRegister(playerid);
      67. forward OnHausesLoad();
      68. forward OnHausCreated(id);
      69. forward updateHaus2(id);
      70. main()
      71. {
      72. print("\n----------------------------------");
      73. print(" Das ist ein Server von ***");
      74. print("----------------------------------\n");
      75. }
      76. public OnGameModeInit()
      77. {
      78. SetGameModeText("CoR-Roleplay");
      79. AddPlayerClass(1,681.7202,-473.8583,16.5363,182.6269,0,0,0,0,0,0);
      80. AddStaticVehicle(411,667.9714,-476.4971,16.0630,246.1584,64,1); // bigboss auto
      81. //MySQL
      82. dbhandle = mysql_connect(db_host,db_user,db_db,db_pass);
      83. //Gebäude laden
      84. for(new i=0; i<sizeof(bInfo); i++)
      85. {
      86. CreatePickup(1239,1,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z],0);
      87. }
      88. //Häuser laden
      89. new query[128];
      90. format(query, sizeof(query), "SELECT * FROM haus");
      91. mysql_function_query(dbhandle, query, true, "OnHausesLoad", "");
      92. return 1;
      93. }
      94. public OnHausesLoad()
      95. {
      96. new num_fields,num_rows;
      97. cache_get_data(num_rows,num_fields,dbhandle);
      98. if(!num_rows)return 1;
      99. for(new i=0; i<num_rows; i++)
      100. {
      101. new id=getFreeHausID();
      102. hInfo[id][h_x]=cache_get_field_content_float(i, "h_x", dbhandle);
      103. hInfo[id][h_y]=cache_get_field_content_float(i, "h_y", dbhandle);
      104. hInfo[id][h_z]=cache_get_field_content_float(i, "h_z", dbhandle);
      105. hInfo[id][ih_x]=cache_get_field_content_float(i, "ih_x", dbhandle);
      106. hInfo[id][ih_y]=cache_get_field_content_float(i, "ih_y", dbhandle);
      107. hInfo[id][ih_z]=cache_get_field_content_float(i, "ih_z", dbhandle);
      108. hInfo[id][h_interior]=cache_get_field_content_int(i, "h_interior", dbhandle);
      109. new tmp_name[MAX_PLAYER_NAME];
      110. cache_get_field_content(i, "besitzer", tmp_name, dbhandle);
      111. strmid(hInfo[id][h_besitzer], tmp_name, 0, sizeof(tmp_name), sizeof(tmp_name));
      112. hInfo[id][h_id]=cache_get_field_content_int(i, "id", dbhandle);
      113. hInfo[id][h_preis]=cache_get_field_content_int(i, "h_preis", dbhandle);
      114. updateHaus(id);
      115. }
      116. return 1;
      117. }
      118. updateHaus(id)
      119. {
      120. if(hInfo[id][h_pickup])
      121. {
      122. DestroyPickup(hInfo[id][h_pickup]);
      123. }
      124. if(hInfo[id][h_text])
      125. {
      126. Delete3DTextLabel(hInfo[id][h_text]);
      127. }
      128. updateHaus2(id);
      129. return 1;
      130. }
      131. public updateHaus2(id)
      132. {
      133. new string[256];
      134. if(!strlen(hInfo[id][h_besitzer]))
      135. {
      136. hInfo[id][h_pickup]=CreatePickup(1273, 1, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], -1);
      137. format(string,sizeof(string), "Zum Verkauf\nKosten: %i$\n/hauskaufen", hInfo[id][h_preis]);
      138. hInfo[id][h_text]=Create3DTextLabel(string, Rot, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], 10, 0, 1);
      139. }
      140. else
      141. {
      142. hInfo[id][h_pickup]=CreatePickup(1239, 1, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], -1);
      143. format(string,sizeof(string), "Besitzer: %s\n/enter", hInfo[id][h_besitzer]);
      144. hInfo[id][h_text]=Create3DTextLabel(string, Blau, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], 10, 0, 1);
      145. }
      146. return 1;
      147. }
      148. public OnGameModeExit()
      149. {
      150. mysql_close(dbhandle);
      151. return 1;
      152. }
      153. public OnPlayerRequestClass(playerid, classid)
      154. {
      155. return 1;
      156. }
      157. public OnPlayerConnect(playerid)
      158. {
      159. SetPlayerColor(playerid,0xFEFEFEFF); // Tab normal
      160. EnableStuntBonusForAll(0);// kein Bonus geld mehr
      161. ShowPlayerMarkers(0); // spieler wir nicht mehr auf ger minimap angezeigt
      162. DisableInteriorEnterExits();// alle Häuser sind aus
      163. UsePlayerPedAnims(); // normal gehen
      164. //Login/Register
      165. new name[MAX_PLAYER_NAME],query[128];
      166. GetPlayerName(playerid,name,sizeof(name));
      167. format(query,sizeof(query),"SELECT id FROM acc WHERE username='%s'",name);
      168. mysql_function_query(dbhandle,query,true,"OnUserCheck","i",playerid);
      169. return 1;
      170. }
      171. public OnUserCheck(playerid)
      172. {
      173. new num_rows,num_fields;
      174. cache_get_data(num_rows,num_fields,dbhandle);
      175. if(num_rows==0)
      176. {
      177. //Registrierung
      178. ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Registrierung","{FFFFFF}Bitte wähle ein Passwort um dir einen {00FFFA}Account{FFFFFF} zu erstellen!\n{FFFFFF}Mit der Registrierung stimmst du automatisch unseren {00FFFA}Regeln{FFFFFF} zu.","Registrieren","Abbrechen");
      179. }
      180. else
      181. {
      182. //Login
      183. ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Status: {C3FF00}Dein Accunt wurde gefunden,warte auf Passworteingabe.","Login","Abbrechen");
      184. }
      185. return 1;
      186. }
      187. saveplayer(playerid)
      188. {
      189. if(sInfo[playerid][eingeloggt]==0)return 1;
      190. //Speichern
      191. new query[128];
      192. format(query,sizeof(query),"UPDATE acc SET level='%i',geld='%i',alevel='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][pid]);
      193. mysql_function_query(dbhandle,query,false,"","");
      194. return 1;
      195. }
      196. resetPlayer(playerid)
      197. {
      198. sInfo[playerid][level]=0;
      199. sInfo[playerid][eingeloggt]=0;
      200. sInfo[playerid][pid]=0;
      201. sInfo[playerid][alevel]=0;
      202. return 1;
      203. }
      204. getFreeHausID()
      205. {
      206. for(new i=0; i<sizeof(hInfo); i++)
      207. {
      208. if(hInfo[i][h_id]==0)return i;
      209. }
      210. return 0;
      211. }
      212. public OnPlayerRegister(playerid)
      213. {
      214. sInfo[playerid][pid] = cache_insert_id(dbhandle);
      215. sInfo[playerid][eingeloggt] = 1;
      216. return 1;
      217. }
      218. public OnPlayerDisconnect(playerid, reason)
      219. {
      220. saveplayer(playerid);
      221. resetPlayer(playerid);
      222. return 1;
      223. }
      224. public OnPlayerSpawn(playerid)
      225. {
      226. return 1;
      227. }
      228. public OnPlayerDeath(playerid, killerid, reason)
      229. {
      230. return 1;
      231. }
      232. public OnVehicleSpawn(vehicleid)
      233. {
      234. return 1;
      235. }
      236. public OnVehicleDeath(vehicleid, killerid)
      237. {
      238. return 1;
      239. }
      240. public OnPlayerText(playerid, text[])
      241. {
      242. return 1;
      243. }
      244. getPlayerName(playerid)
      245. {
      246. new name[MAX_PLAYER_NAME];
      247. GetPlayerName(playerid, name, sizeof(name));
      248. return name;
      249. }
      250. hatPlayerHaus(playerid)
      251. {
      252. new name[MAX_PLAYER_NAME];
      253. GetPlayerName(playerid, name, sizeof(name));
      254. for(new i=0; i<sizeof(hInfo); i++)
      255. {
      256. if(!hInfo[i][h_id])continue;
      257. if(!strlen(hInfo[i][h_besitzer]))continue;
      258. if(!strcmp(name, hInfo[i][h_besitzer], true))return 1;
      259. }
      260. return 0;
      261. }
      262. saveHaus(id)
      263. {
      264. new query[128];
      265. format(query, sizeof(query), "UPDATE haus SET besitzer='%s', h_preis='%i' WHERE id='%i'", hInfo[id][h_besitzer], hInfo[id][h_preis], hInfo[id][h_id]);
      266. mysql_function_query(dbhandle, query, false, "", "");
      267. return 1;
      268. }
      269. public OnHausCreated(id)
      270. {
      271. hInfo[id][h_id]=cache_insert_id();
      272. }
      273. //Befehle
      274. ocmd:exit(playerid, params[])
      275. {
      276. for(new i=0; i<sizeof(bInfo); i++)
      277. {
      278. if(GetPlayerVirtualWorld(playerid)!=i)continue;
      279. if(!IsPlayerInRangeOfPoint(playerid,2,bInfo[i][b_ix],bInfo[i][b_iy],bInfo[i][b_iz]))continue;
      280. SetPlayerPos(playerid,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z]);
      281. SetPlayerInterior(playerid,0);
      282. SetPlayerVirtualWorld(playerid,0);
      283. }
      284. return 1;
      285. }
      286. ocmd:enter(playerid, params[])
      287. {
      288. for(new i=0; i<sizeof(bInfo); i++)
      289. {
      290. if(!IsPlayerInRangeOfPoint(playerid,2,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z]))continue;
      291. SetPlayerPos(playerid,bInfo[i][b_ix],bInfo[i][b_iy],bInfo[i][b_iz]);
      292. SetPlayerInterior(playerid,bInfo[i][b_interior]);
      293. SetPlayerVirtualWorld(playerid,i);
      294. return 1;
      295. }
      296. return 1;
      297. }
      298. ocmd:deletehaus(playerid, params[])
      299. {
      300. if(!isAdmin(playerid, 2000))return
      301. SendClientMessage(playerid, Rot, "Dein Adminrang ist zu niedrig.");
      302. for(new i=0; i<sizeof(hInfo); i++)
      303. {
      304. if(!hInfo[i][h_id])continue;
      305. if(!IsPlayerInRangeOfPoint(playerid, 5,
      306. hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
      307. new query[128];
      308. format(query,sizeof(query),
      309. "DELETE FROM haus WHERE id='%i'", hInfo[i][h_id]);
      310. mysql_function_query(dbhandle, query, false, "", "");
      311. hInfo[i][h_x]=0.0;
      312. hInfo[i][h_y]=0.0;
      313. hInfo[i][h_z]=0.0;
      314. hInfo[i][ih_x]=0.0;
      315. hInfo[i][ih_y]=0.0;
      316. hInfo[i][ih_z]=0.0;
      317. hInfo[i][h_id]=0;
      318. hInfo[i][h_preis]=0;
      319. hInfo[i][h_interior]=0;
      320. if(hInfo[i][h_pickup])
      321. {
      322. DestroyPickup(hInfo[i][h_pickup]);
      323. }
      324. if(hInfo[i][h_text])
      325. {
      326. Delete3DTextLabel(hInfo[i][h_text]);
      327. }
      328. return 1;
      329. }
      330. return 1;
      331. }
      332. ocmd:createhaus(playerid, params[])
      333. {
      334. if(!isAdmin(playerid, 2000))return
      335. SendClientMessage(playerid, Rot, "Dein Adminrang ist zu niedrig.");
      336. new Float:xc, Float:yc, Float:zc;
      337. GetPlayerPos(playerid, xc, yc, zc);
      338. new id=getFreeHausID();
      339. hInfo[id][h_x]=xc;
      340. hInfo[id][h_y]=yc;
      341. hInfo[id][h_z]=zc;
      342. hInfo[id][ih_x]=0.0;
      343. hInfo[id][ih_y]=0.0;
      344. hInfo[id][ih_z]=0.0;
      345. hInfo[id][h_interior]=0;
      346. strmid(hInfo[id][h_besitzer], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
      347. hInfo[id][h_preis]=15000;
      348. updateHaus(id);
      349. //In Datenbank abspeichern
      350. new query[256];
      351. format(query, sizeof(query),
      352. "INSERT INTO haus (h_x, h_y, h_z, ih_x, ih_y, ih_z, h_interior, h_preis) VALUES ('%f', '%f', '%f', '0.0', '0.0', '0.0', '0', '1')",
      353. xc, yc, zc);
      354. mysql_function_query(dbhandle, query, true, "OnHausCreated", "i", id);
      355. return 1;
      356. }
      357. ocmd:hausverkaufen(playerid, params[])
      358. {
      359. new name[MAX_PLAYER_NAME];
      360. GetPlayerName(playerid, name, sizeof(name));
      361. for(new i=0; i<sizeof(hInfo); i++)
      362. {
      363. if(!hInfo[i][h_id])continue;
      364. if(!IsPlayerInRangeOfPoint(playerid, 5,
      365. hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
      366. if(!strlen(hInfo[i][h_besitzer]))continue;
      367. if(!strcmp(hInfo[i][h_besitzer], name, true))
      368. {
      369. hInfo[i][h_preis]=hInfo[i][h_preis]/2;
      370. GivePlayerMoney(playerid, hInfo[i][h_preis]);
      371. strmid(hInfo[i][h_besitzer], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
      372. updateHaus(i);
      373. saveHaus(i);
      374. return 1;
      375. }
      376. }
      377. return 1;
      378. }
      379. ocmd:hauskaufen(playerid, params[])
      380. {
      381. if(hatPlayerHaus(playerid))return
      382. SendClientMessage(playerid, Rot, "Du hast bereits ein Haus.");
      383. for(new i=0; i<sizeof(hInfo); i++)
      384. {
      385. if(!hInfo[i][h_id])continue;
      386. if(!IsPlayerInRangeOfPoint(playerid, 5,
      387. hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
      388. if(!strlen(hInfo[i][h_besitzer]))
      389. {
      390. if(GetPlayerMoney(playerid)<hInfo[i][h_preis])return
      391. SendClientMessage(playerid, Rot, "Du hast nicht genügend Geld.");
      392. GivePlayerMoney(playerid, -hInfo[i][h_preis]);
      393. strmid(hInfo[i][h_besitzer], getPlayerName(playerid), 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
      394. updateHaus(i);
      395. saveHaus(i);
      396. return 1;
      397. }
      398. return SendClientMessage(playerid, Rot,
      399. "Das Haus steht nicht zum Verkauf.");
      400. }
      401. return 1;
      402. }
      403. ocmd:tp(playerid,params[])
      404. {
      405. if(!isAdmin(playerid,3))return SendClientMessage(playerid,Rot,"Info: Dein Adminlevel ist zu niedrig!");
      406. ShowPlayerDialog(playerid,DIALOG_TP,DIALOG_STYLE_LIST,"Wohin willst du dich teleportieren?","Spawn\nBSN","Teleport","Abbrechen");
      407. return 1;
      408. }
      409. ocmd:setadmin(playerid, params[])
      410. {
      411. if(!isAdmin(playerid,2000))return SendClientMessage(playerid,Rot,"Info: Dein Adminlevel ist zu niedrig!");
      412. new a_id,a_level,string[256],aName[MAX_PLAYER_NAME],aName2[MAX_PLAYER_NAME];
      413. if(sscanf(params,"ui",a_id,a_level))return SendClientMessage(playerid,Rot,"Info: /setadmin [Playerid] [Admin-Level]");
      414. sInfo[a_id][alevel]=a_level;
      415. saveplayer(pid);
      416. GetPlayerName(playerid, aName, sizeof(aName));
      417. GetPlayerName(a_id, aName2, sizeof(aName2));
      418. format(string, sizeof(string), "Info: %s hat das Admin-Level von %s auf %d geändert. ",aName, aName2, a_level);
      419. SendClientMessage(a_id,Türkis,string);
      420. format(string, sizeof(string), "Info: %s hat das Admin-Level von %s auf %d erfolgreich geändert ",aName, aName2, a_level);
      421. SendClientMessage(playerid,Türkis,string);
      422. return 1;
      423. }
      424. ocmd:pn(playerid, params[])
      425. {
      426. new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
      427. if(sscanf(params, "us[256]", id, str2))
      428. {
      429. SendClientMessage(playerid, Rot, "Info: /pn [Playerid] [Text]");
      430. return 1;
      431. }
      432. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Rot, "Info: Spieler nicht gefunden");
      433. if(playerid == id) return SendClientMessage(playerid, Rot, "Info: Du kannst dir nicht selber schreiben!");
      434. {
      435. GetPlayerName(playerid, Name1, sizeof(Name1));
      436. GetPlayerName(id, Name2, sizeof(Name2));
      437. format(str, sizeof(str), "PN von %s (ID %d): %s", Name1, playerid, str2);
      438. SendClientMessage(id, Grün, str);
      439. format(str, sizeof(str), "PN zu %s (ID %d): %s", Name2, id, str2);
      440. SendClientMessage(playerid, Grün, str);
      441. }
      442. return 1;
      443. }
      444. ocmd:gmx(playerid,parmas[])
      445. {
      446. if(!isAdmin(playerid,2000))return SendClientMessage(playerid,Rot,"Dein Adminlevel ist zu niedrig!");
      447. GameTextForPlayer(playerid,"Server NEUSTART!",2900,3);
      448. SendClientMessage(playerid,Rot,"Info: Du wurdest gekickt Grund : SERVER NEUSTART!!");
      449. SetTimer("akick",1000,false);
      450. return 1;
      451. }
      452. isAdmin(playerid,a_level)
      453. {
      454. if(sInfo[playerid][alevel]>=a_level)return 1;
      455. return 0;
      456. }
      457. public akick()
      458. {
      459. for(new i=0; i<MAX_PLAYERS; i++)
      460. {
      461. Kick(i);
      462. }
      463. SetTimer("neustart",1300,false);
      464. return 1;
      465. }
      466. public neustart()
      467. {
      468. SendRconCommand("gmx");
      469. return 1;
      470. }
      471. public OnPlayerCommandText(playerid, cmdtext[])
      472. {
      473. return 1;
      474. }
      475. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
      476. {
      477. return 1;
      478. }
      479. public OnPlayerExitVehicle(playerid, vehicleid)
      480. {
      481. return 1;
      482. }
      483. public OnPlayerStateChange(playerid, newstate, oldstate)
      484. {
      485. return 1;
      486. }
      487. public OnPlayerEnterCheckpoint(playerid)
      488. {
      489. return 1;
      490. }
      491. public OnPlayerLeaveCheckpoint(playerid)
      492. {
      493. return 1;
      494. }
      495. public OnPlayerEnterRaceCheckpoint(playerid)
      496. {
      497. return 1;
      498. }
      499. public OnPlayerLeaveRaceCheckpoint(playerid)
      500. {
      501. return 1;
      502. }
      503. public OnRconCommand(cmd[])
      504. {
      505. return 1;
      506. }
      507. public OnPlayerRequestSpawn(playerid)
      508. {
      509. return 1;
      510. }
      511. public OnObjectMoved(objectid)
      512. {
      513. return 1;
      514. }
      515. public OnPlayerObjectMoved(playerid, objectid)
      516. {
      517. return 1;
      518. }
      519. public OnPlayerPickUpPickup(playerid, pickupid)
      520. {
      521. return 1;
      522. }
      523. public OnVehicleMod(playerid, vehicleid, componentid)
      524. {
      525. return 1;
      526. }
      527. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
      528. {
      529. return 1;
      530. }
      531. public OnVehicleRespray(playerid, vehicleid, color1, color2)
      532. {
      533. return 1;
      534. }
      535. public OnPlayerSelectedMenuRow(playerid, row)
      536. {
      537. return 1;
      538. }
      539. public OnPlayerExitedMenu(playerid)
      540. {
      541. return 1;
      542. }
      543. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
      544. {
      545. return 1;
      546. }
      547. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
      548. {
      549. return 1;
      550. }
      551. public OnRconLoginAttempt(ip[], password[], success)
      552. {
      553. return 1;
      554. }
      555. public OnPlayerUpdate(playerid)
      556. {
      557. return 1;
      558. }
      559. public OnPlayerStreamIn(playerid, forplayerid)
      560. {
      561. return 1;
      562. }
      563. public OnPlayerStreamOut(playerid, forplayerid)
      564. {
      565. return 1;
      566. }
      567. public OnVehicleStreamIn(vehicleid, forplayerid)
      568. {
      569. return 1;
      570. }
      571. public OnVehicleStreamOut(vehicleid, forplayerid)
      572. {
      573. return 1;
      574. }
      575. SetPlayerMoney(playerid,money)
      576. {
      577. ResetPlayerMoney(playerid);
      578. GivePlayerMoney(playerid,money);
      579. return 1;
      580. }
      581. public OnPasswortCheck(playerid)
      582. {
      583. new num_rows,num_fields;
      584. cache_get_data(num_rows,num_fields,dbhandle);
      585. if(num_rows==1)
      586. {
      587. //Passwort richtig
      588. sInfo[playerid][eingeloggt] = 1;
      589. sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
      590. SetPlayerScore(playerid,sInfo[playerid][level]);
      591. sInfo[playerid][pid] = cache_get_field_content_int(0,"id",dbhandle);
      592. sInfo[playerid][geld] = cache_get_field_content_int(0,"geld",dbhandle);
      593. SetPlayerMoney(playerid,sInfo[playerid][geld]);
      594. sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
      595. }
      596. else
      597. {
      598. //Passwort falsch
      599. SendClientMessage(playerid,Rot,"Info: Das eingegebene Passwort ist falsch.");
      600. SendClientMessage(playerid,Rot,"Info: Hast du dein Passwort vergessen? Dan wende dich an den Support.");
      601. ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Status: {C3FF00}Dein Accunt wurde gefunden,warte auf Passworteingabe.","Login","Abbrechen");
      602. }
      603. return 1;
      604. }
      605. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
      606. {
      607. if(dialogid==DIALOG_LOGIN)
      608. {
      609. if(response)
      610. {
      611. new name[MAX_PLAYER_NAME],query[128],passwort[128];
      612. GetPlayerName(playerid,name,sizeof(name));
      613. if(strlen(inputtext)>0)
      614. {
      615. mysql_escape_string(inputtext,passwort,dbhandle);
      616. format(query,sizeof(query),"SELECT * FROM acc WHERE username ='%s'AND passwort= MD5('%s')",name,passwort);
      617. mysql_function_query(dbhandle,query,true,"OnPasswortCheck","i",playerid);
      618. }
      619. else
      620. {
      621. //Kein Eingabe
      622. SendClientMessage(playerid,Rot,"Info: Bitte gibt dein Passwort ein.");
      623. ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Status: {C3FF00}Dein Accunt wurde gefunden,warte auf Passworteingabe.","Login","Abbrechen");
      624. }
      625. }
      626. else
      627. {
      628. Kick(playerid);
      629. }
      630. return 1;
      631. }
      632. if(dialogid==DIALOG_REGISTER)
      633. {
      634. if(response)
      635. {
      636. new name[MAX_PLAYER_NAME],query[128],passwort[128];
      637. GetPlayerName(playerid,name,sizeof(name));
      638. if(strlen(inputtext)>3)
      639. {
      640. //Registrierungsfunktion
      641. mysql_escape_string(inputtext,passwort,dbhandle);
      642. format(query,sizeof(query),"INSERT INTO acc (username,passwort) VALUES('%s',MD5('%s'))",name,passwort);
      643. mysql_function_query(dbhandle,query,true,"OnPlayerRegister","i",playerid);
      644. AddPlayerClass(1,681.7202,-473.8583,16.5363,182.6269,0,0,0,0,0,0);
      645. }
      646. else
      647. {
      648. //Kleiner als 3 Zeichen
      649. SendClientMessage(playerid,Rot,"Info: Dein Passwort muss mindestens 4 Zeichen lang sein.");
      650. ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Registrierung","{FFFFFF}Bitte wähle ein Passwort um dir einen {00FFFA}Account{FFFFFF} zu erstellen!\n{FFFFFF}Mit der Registrierung stimmst du automatisch unseren {00FFFA}Regeln{FFFFFF} zu.","Registrieren","Abbrechen");
      651. }
      652. }
      653. else
      654. {
      655. Kick(playerid);
      656. }
      657. return 1;
      658. }
      659. if(dialogid==DIALOG_TP)
      660. {
      661. if(response)
      662. {
      663. if(listitem==0)
      664. {
      665. //Spawn
      666. new tmpcar = GetPlayerVehicleID(playerid);
      667. SetVehiclePos(tmpcar,697.6049,-473.5656,16.3359);
      668. LinkVehicleToInterior(tmpcar,0);
      669. SetPlayerVirtualWorld(playerid,0);
      670. TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
      671. SendClientMessage(playerid,Gelb,"Du hast dich erfolgreich zum Spawn geportet.");
      672. }
      673. {
      674. if(listitem==1)
      675. {
      676. //BSN
      677. new tmpcar = GetPlayerVehicleID(playerid);
      678. SetVehiclePos(tmpcar,1211.8396,-874.5818,42.9138);
      679. LinkVehicleToInterior(tmpcar,0);
      680. SetPlayerVirtualWorld(playerid,0);
      681. TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
      682. SendClientMessage(playerid,Gelb,"Du hast dich erfolgreich zum BSN geportet.");
      683. }
      684. }
      685. }
      686. else
      687. {
      688. SendClientMessage(playerid,Rot,"Info: Du hast den Vorgang abgebrochen.");
      689. }
      690. }
      691. return 1;
      692. }
      693. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
      694. {
      695. return 1;
      696. }
      Alles anzeigen