Nützliche Codeschnipsel
- breadfish
- Geschlossen
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
-
-
Hallo alle zusammen, heute möchte ich einen kleinen Fix posten.
Manche kennen eventuell diese Include
http://forum.sa-mp.com/showthread.php?p=2362690Da ich eine einfachere Lösung gefunden habe um diesen Fehler zu behebt möchte ich das ganze hier posten, wenn man
TogglePlayerSpectating(playerid,true);
nutzen möchte und anschließend SetPlayerCameraPos und SetPlayerCameraLookAt so bleibt die Kamera automatisch an der Blueberry Farm hängen.
Lösung:
#define SetPlayerCamera(%0, %1, %2, %3, %4, %5, %6) InterpolateCameraPos(%0, %1, %2, %3, %1, %2, %3, 1000, CAMERA_CUT),InterpolateCameraLookAt(%0, %4, %5, %6, %4, %5, %6, 1000, CAMERA_CUT);
-
Ich habe gerade was lustiges herausgefunden, man kann mit dem Pawn-Compiler if-Abfragen auch so schreiben:
new a=5;
if a==5 *then print("a=5");Dieses *then habe ich bis jetzt noch nie in irgendeinem Skript gesehen, weil es natürlich total überflüssig ist, wenn man auch einfach nur Klammern setzen kann, fand es aber mal ganz nützlich zu wissen, dass so ein "then" auch in Pawn existiert
mfg.
-
Damit man nicht immer #define FARBE machen muss:
enum //Farben
{
COLOR_RED = 0xFF0005FF,
COLOR_GREEN = 0x00FF00FF
//Weitere Farben einfügen & Komma nach dem Farbcode nicht vergessen!
}Nutzung:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, COLOR_RED, "Das ist eine Nachricht.");
return 1;
} -
Beitrag von seegras ()
Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar. -
Beitrag von Dr.Almighty ()
Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar. -
Manche nutzen ja immer noch das alte MySQL Plugin von BlueG R5 oder R6, wegen dem Tutorial von maddin, daher wollte ich mit meinem Codeschnipsel zeigen, das man wie früher auch bei der neuen Version ohne Probleme mit mysql_query arbeiten kann , das einzige Problem dabei ist das die queries nicht threaded sind.
C
Alles anzeigenstock mysql_SetInt(Table[], Field[], To, Where[], Where2[], connectionHandle = 1) { new query[128]; mysql_format(connectionHandle, query, sizeof(query), "UPDATE `%e` SET `%e` = '%d' WHERE `%e` = '%e';", Table, Field, To, Where, Where2); mysql_tquery(connectionHandle, query, "", ""); return true; } stock mysql_SetString(Table[], Field[], To[], Where[], Where2[], connectionHandle = 1) { new query[128]; mysql_format(connectionHandle, query, sizeof(query), "UPDATE `%e` SET `%e` = '%e' WHERE `%e` = '%e'", Table, Field, To, Where, Where2); mysql_tquery(connectionHandle, query, "", ""); return true; } stock mysql_SetFloat(Table[], Field[], Float:To, Where[], Where2[], connectionHandle = 1) { new query[128]; mysql_format(connectionHandle, query, sizeof(query), "UPDATE `%e` SET `%e` = '%f' WHERE `%e` = '%e';", Table, Field, To, Where, Where2); mysql_tquery(connectionHandle, query, "", ""); return true; } stock mysql_GetString(Table[], Field[], Where[], Is[], connectionHandle = 1) { new query[128], Get[128]; mysql_format(connectionHandle, query, sizeof(query), "SELECT `%e` FROM `%e` WHERE `%e` = '%e' LIMIT 1;", Table, Field, To, Where, Where2); new Cache:result = mysql_query(connectionHandle, query); cache_get_row(0, 0, Get); cache_delete(result); return Get; } stock mysql_GetInt(Table[], Field[], Where[], Is[], connectionHandle = 1) { new query[128], Float:sqlint; mysql_format(connectionHandle, query, sizeof(query), "SELECT `%e` FROM `%e` WHERE `%e` = '%e' LIMIT 1;", Table, Field, To, Where, Where2); new Cache:result = mysql_query(connectionHandle, query); sqlint = cache_get_row_int(0, 0, Get); cache_delete(result); return sqlint; } stock mysql_GetFloat(Table[], Field[], Where[], Is[], connectionHandle = 1) { new query[128], Float:sqlfloat; mysql_format(connectionHandle, query, sizeof(query), "SELECT `%e` FROM `%e` WHERE `%e` = '%e' LIMIT 1;", Table, Field, To, Where, Where2); new Cache:result = mysql_query(connectionHandle, query); sqlfloat = cache_get_row_float(0, 0, Get); cache_delete(result); return _:sqlfloat; }
-
-
Hey,
Ich habe hier ein Actor System viel Spaß damit.
#undef MAX_ACTORS
#define MAX_ACTORS 175new Actor[MAX_ACTORS];
enum ActorInfo {
ActorModelID,
Float:ActorX,
Float:ActorY,
Float:ActorZ,
Float:ActorRotation,
ActorVirtualWorld,
ActorInterior,
ActorAnimLib[32],
ActorAnimName[32]
}new const ActorDatei[MAX_ACTORS][ActorInfo] = {
{187, 359.7168, 173.5962, 1008.3893, 270.2794, 0, 3, "PED", "SEAT_idle"}, // (0) Actor Stadthalle
{205, 376.5479, -65.8478, 1001.5078, 179.6697, 0, 10, "DEALER", "DEALER_IDLE"}, // (1) Actor Burger Shot 1 (BSN)
{205, 375.2841, -65.6269, 1001.5078, 89.7673, 0, 10, "COP_AMBIENT", "Coplook_loop"}, // (2) Actor Burger Shot 2 (BSN)
{205, 376.3631, -61.1888, 1001.5078, 93.8281, 0, 10, "INT_SHOP", "shop_loop"}, // (3) Actor Burger Shot 3 Koch (BSN)
{205, 377.8304, -57.5024, 1001.5078, 1.2185, 0, 10, "INT_SHOP", "shop_loop"}, // (4) Actor Burger Shot 4 Koch (BSN){205, 376.5479, -65.8478, 1001.5078, 179.6697, 1, 10, "COP_AMBIENT", "Coplook_loop"}, // (5) Actor Burger Shot 1 (Marina)
{205, 375.2841, -65.6269, 1001.5078, 89.7673, 1, 10, "DEALER", "DEALER_IDLE"}, // (6) Actor Burger Shot 2 (Marina)
{205, 376.3631, -61.1888, 1001.5078, 93.8281, 1, 10, "INT_SHOP", "shop_loop"}, // (7) Actor Burger Shot 3 Koch (Marina)
{205, 377.8304, -57.5024, 1001.5078, 1.2185, 1, 10, "INT_SHOP", "shop_loop"}, // (8) Actor Burger Shot 4 Koch (Marina){205, 376.5479, -65.8478, 1001.5078, 179.6697, 2, 10, "DEALER", "DEALER_IDLE"}, // (9) Actor Burger Shot 1 (Garcia)
{205, 375.2841, -65.6269, 1001.5078, 89.7673, 2, 10, "COP_AMBIENT", "Coplook_loop"}, // (10) Actor Burger Shot 2 (Garcia)
{205, 376.3631, -61.1888, 1001.5078, 93.8281, 2, 10, "INT_SHOP", "shop_loop"}, // (11) Actor Burger Shot 3 Koch (Garcia)
{205, 377.8304, -57.5024, 1001.5078, 1.2185, 2, 10, "INT_SHOP", "shop_loop"}, // (12) Actor Burger Shot 4 Koch (Garcia){205, 376.5479, -65.8478, 1001.5078, 179.6697, 3, 10, "COP_AMBIENT", "Coplook_loop"}, // (13) Actor Burger Shot 1 (Redsands East)
{205, 375.2841, -65.6269, 1001.5078, 89.7673, 3, 10, "DEALER", "DEALER_IDLE"}, // (14) Actor Burger Shot 2 (Redsands East)
{205, 376.3631, -61.1888, 1001.5078, 93.8281, 3, 10, "INT_SHOP", "shop_loop"}, // (15) Actor Burger Shot 3 Koch (Redsands East)
{205, 377.8304, -57.5024, 1001.5078, 1.2185, 3, 10, "INT_SHOP", "shop_loop"}, // (16) Actor Burger Shot 4 Koch (Redsands East){205, 376.5479, -65.8478, 1001.5078, 179.6697, 4, 10, "DEALER", "DEALER_IDLE"}, // (17) Actor Burger Shot 1 (Downtown San Fierro)
{205, 375.2841, -65.6269, 1001.5078, 89.7673, 4, 10, "COP_AMBIENT", "Coplook_loop"}, // (18) Actor Burger Shot 2 (Downtown San Fierro)
{205, 376.3631, -61.1888, 1001.5078, 93.8281, 4, 10, "INT_SHOP", "shop_loop"}, // (19) Actor Burger Shot 3 Koch (Downtown San Fierro)
{205, 377.8304, -57.5024, 1001.5078, 1.2185, 4, 10, "INT_SHOP", "shop_loop"}, // (20) Actor Burger Shot 4 Koch (Downtown San Fierro){205, 376.5479, -65.8478, 1001.5078, 179.6697, 5, 10, "COP_AMBIENT", "Coplook_loop"}, // (21) Actor Burger Shot 1 (Old Venturas Strip)
{205, 375.2841, -65.6269, 1001.5078, 89.7673, 5, 10, "DEALER", "DEALER_IDLE"}, // (22) Actor Burger Shot 2 (Old Venturas Strip)
{205, 376.3631, -61.1888, 1001.5078, 93.8281, 5, 10, "INT_SHOP", "shop_loop"}, // (23) Actor Burger Shot 3 Koch (Old Venturas Strip)
{205, 377.8304, -57.5024, 1001.5078, 1.2185, 5, 10, "INT_SHOP", "shop_loop"}, // (24) Actor Burger Shot 4 Koch (Old Venturas Strip){205, 376.5479, -65.8478, 1001.5078, 179.6697, 6, 10, "DEALER", "DEALER_IDLE"}, // (25) Actor Burger Shot 1 (Spinybed)
{205, 375.2841, -65.6269, 1001.5078, 89.7673, 6, 10, "DEALER", "DEALER_IDLE"}, // (26) Actor Burger Shot 2 (Spinybed)
{205, 376.3631, -61.1888, 1001.5078, 93.8281, 6, 10, "INT_SHOP", "shop_loop"}, // (27) Actor Burger Shot 3 Koch (Spinybed)
{205, 377.8304, -57.5024, 1001.5078, 1.2185, 6, 10, "INT_SHOP", "shop_loop"}, // (28) Actor Burger Shot 4 Koch (Spinybed){205, 376.5479, -65.8478, 1001.5078, 179.6697, 7, 10, "DEALER", "DEALER_IDLE"}, // (29) Actor Burger Shot 1 (Whitewood Estates)
{205, 375.2841, -65.6269, 1001.5078, 89.7673, 7, 10, "DEALER", "DEALER_IDLE"}, // (30) Actor Burger Shot 2 (Whitewood Estates)
{205, 376.3631, -61.1888, 1001.5078, 93.8281, 7, 10, "INT_SHOP", "shop_loop"}, // (31) Actor Burger Shot 3 Koch (Whitewood Estates)
{205, 377.8304, -57.5024, 1001.5078, 1.2185, 7, 10, "INT_SHOP", "shop_loop"}, // (32) Actor Burger Shot 4 Koch (Whitewood Estates){167, 368.1019, -4.4912, 1001.8516, 179.0258, 0, 9, "COP_AMBIENT", "Coplook_loop"}, // (33) Actor Cluckin Bell 1 (Market)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 0, 9, "DEALER", "DEALER_IDLE"}, // (34) Actor Cluckin Bell 2 (Market){167, 368.1019, -4.4912, 1001.8516, 179.0258, 1, 9, "DEALER", "DEALER_IDLE"}, // (35) Actor Cluckin Bell 1 (Downtown San Fierro)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 1, 9, "DEALER", "DEALER_IDLE"}, // (36) Actor Cluckin Bell 2 (Downtown San Fierro){167, 368.1019, -4.4912, 1001.8516, 179.0258, 2, 9, "COP_AMBIENT", "Coplook_loop"}, // (37) Actor Cluckin Bell 1 (Willowfield)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 2, 9, "DEALER", "DEALER_IDLE"}, // (38) Actor Cluckin Bell 2 (Willowfield){167, 368.1019, -4.4912, 1001.8516, 179.0258, 3, 9, "COP_AMBIENT", "Coplook_loop"}, // (39) Actor Cluckin Bell 1 (Tierra Robada)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 3, 9, "COP_AMBIENT", "Coplook_loop"}, // (40) Actor Cluckin Bell 2 (Tierra Robada){167, 368.1019, -4.4912, 1001.8516, 179.0258, 4, 9, "DEALER", "DEALER_IDLE"}, // (41) Actor Cluckin Bell 1 (East Los Santos)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 4, 9, "DEALER", "DEALER_IDLE"}, // (42) Actor Cluckin Bell 2 (East Los Santos){167, 368.1019, -4.4912, 1001.8516, 179.0258, 5, 9, "DEALER", "DEALER_IDLE"}, // (43) Actor Cluckin Bell 1 (Old Venturas Strip)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 5, 9, "COP_AMBIENT", "Coplook_loop"}, // (44) Actor Cluckin Bell 2 (Old Venturas Strip){167, 368.1019, -4.4912, 1001.8516, 179.0258, 6, 9, "COP_AMBIENT", "Coplook_loop"}, // (45) Actor Cluckin Bell 1 (Creek)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 6, 9, "COP_AMBIENT", "Coplook_loop"}, // (46) Actor Cluckin Bell 2 (Creek){167, 368.1019, -4.4912, 1001.8516, 179.0258, 7, 9, "DEALER", "DEALER_IDLE"}, // (47) Actor Cluckin Bell 1 (Bone County)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 7, 9, "DEALER", "DEALER_IDLE"}, // (48) Actor Cluckin Bell 2 (Bone County){167, 368.1019, -4.4912, 1001.8516, 179.0258, 8, 9, "DEALER", "DEALER_IDLE"}, // (49) Actor Cluckin Bell 1 (Pilgrim)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 8, 9, "DEALER", "DEALER_IDLE"}, // (50) Actor Cluckin Bell 2 (Pilgrim){167, 368.1019, -4.4912, 1001.8516, 179.0258, 9, 9, "COP_AMBIENT", "Coplook_loop"}, // (51) Actor Cluckin Bell 1 (Emerald Isle)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 9, 9, "DEALER", "DEALER_IDLE"}, // (52) Actor Cluckin Bell 2 (Emerald Isle){167, 368.1019, -4.4912, 1001.8516, 179.0258, 10, 9, "COP_AMBIENT", "Coplook_loop"}, // (53) Actor Cluckin Bell 1 (Angel Pine)
{167, 370.9120, -4.4926, 1001.8589, 178.9130, 10, 9, "DEALER", "DEALER_IDLE"}, // (54) Actor Cluckin Bell 2 (Angel Pine){155, 372.6779, -117.2779, 1001.4922, 182.0592, 0, 5, "DEALER", "DEALER_IDLE"}, // (55) Actor Pizza Steck 1 (Idleewood)
{155, 374.7041, -117.2758, 1001.4922, 182.9616, 0, 5, "COP_AMBIENT", "Coplook_loop"}, // (56) Actor Pizza Steck 2 (Idleewood)
{155, 376.6478, -117.2785, 1001.4922, 183.3000, 0, 5, "DEALER", "DEALER_IDLE"}, // (57) Actor Pizza Steck 3 (Idleewood)
{155, 374.8322, -113.6196, 1001.4922, 358.2544, 0, 5, "INT_SHOP", "shop_loop"}, // (58) Actor Pizza Steck 4 Koch (Idleewood)
{155, 372.5408, -113.7303, 1001.4922, 353.9679, 0, 5, "INT_SHOP", "shop_loop"}, // (59) Actor Pizza Steck 5 Koch (Idleewood){155, 372.6779, -117.2779, 1001.4922, 182.0592, 1, 5, "DEALER", "DEALER_IDLE"}, // (60) Actor Pizza Steck 1 (Palomino Creek)
{155, 374.7041, -117.2758, 1001.4922, 182.9616, 1, 5, "COP_AMBIENT", "Coplook_loop"}, // (61) Actor Pizza Steck 2 (Palomino Creek)
{155, 376.6478, -117.2785, 1001.4922, 183.3000, 1, 5, "DEALER", "DEALER_IDLE"}, // (62) Actor Pizza Steck 3 (Palomino Creek)
{155, 374.8322, -113.6196, 1001.4922, 358.2544, 1, 5, "INT_SHOP", "shop_loop"}, // (63) Actor Pizza Steck 4 Koch (Palomino Creek)
{155, 372.5408, -113.7303, 1001.4922, 353.9679, 1, 5, "INT_SHOP", "shop_loop"}, // (64) Actor Pizza Steck 5 Koch (Palomino Creek){155, 372.6779, -117.2779, 1001.4922, 182.0592, 2, 5, "COP_AMBIENT", "Coplook_loop"}, // (65) Actor Pizza Steck 1 (Montgomery)
{155, 374.7041, -117.2758, 1001.4922, 182.9616, 2, 5, "DEALER", "DEALER_IDLE"}, // (66) Actor Pizza Steck 2 (Montgomery)
{155, 376.6478, -117.2785, 1001.4922, 183.3000, 2, 5, "DEALER", "DEALER_IDLE"}, // (67) Actor Pizza Steck 3 (Montgomery)
{155, 374.8322, -113.6196, 1001.4922, 358.2544, 2, 5, "INT_SHOP", "shop_loop"}, // (68) Actor Pizza Steck 4 Koch (Montgomery)
{155, 372.5408, -113.7303, 1001.4922, 353.9679, 2, 5, "INT_SHOP", "shop_loop"}, // (69) Actor Pizza Steck 5 Koch (Montgomery){155, 372.6779, -117.2779, 1001.4922, 182.0592, 3, 5, "COP_AMBIENT", "Coplook_loop"}, // (70) Actor Pizza Steck 1 (Blueberry)
{155, 374.7041, -117.2758, 1001.4922, 182.9616, 3, 5, "DEALER", "DEALER_IDLE"}, // (71) Actor Pizza Steck 2 (Blueberry)
{155, 376.6478, -117.2785, 1001.4922, 183.3000, 3, 5, "DEALER", "DEALER_IDLE"}, // (72) Actor Pizza Steck 3 (Blueberry)
{155, 374.8322, -113.6196, 1001.4922, 358.2544, 3, 5, "INT_SHOP", "shop_loop"}, // (73) Actor Pizza Steck 4 Koch (Blueberry)
{155, 372.5408, -113.7303, 1001.4922, 353.9679, 3, 5, "INT_SHOP", "shop_loop"}, // (74) Actor Pizza Steck 5 Koch (Blueberry){155, 372.6779, -117.2779, 1001.4922, 182.0592, 4, 5, "DEALER", "DEALER_IDLE"}, // (75) Actor Pizza Steck 1 (Emerald Isle)
{155, 374.7041, -117.2758, 1001.4922, 182.9616, 4, 5, "DEALER", "DEALER_IDLE"}, // (76) Actor Pizza Steck 2 (Emerald Isle)
{155, 376.6478, -117.2785, 1001.4922, 183.3000, 4, 5, "COP_AMBIENT", "Coplook_loop"}, // (77) Actor Pizza Steck 3 (Emerald Isle)
{155, 374.8322, -113.6196, 1001.4922, 358.2544, 4, 5, "INT_SHOP", "shop_loop"}, // (78) Actor Pizza Steck 4 Koch (Emerald Isle)
{155, 372.5408, -113.7303, 1001.4922, 353.9679, 4, 5, "INT_SHOP", "shop_loop"}, // (79) Actor Pizza Steck 5 Koch (Emerald Isle){155, 372.6779, -117.2779, 1001.4922, 182.0592, 5, 5, "COP_AMBIENT", "Coplook_loop"}, // (80) Actor Pizza Steck 1 (Espalande North San Fierro)
{155, 374.7041, -117.2758, 1001.4922, 182.9616, 5, 5, "DEALER", "DEALER_IDLE"}, // (81) Actor Pizza Steck 2 (Espalande North San Fierro)
{155, 376.6478, -117.2785, 1001.4922, 183.3000, 5, 5, "COP_AMBIENT", "Coplook_loop"}, // (82) Actor Pizza Steck 3 (Espalande North San Fierro)
{155, 374.8322, -113.6196, 1001.4922, 358.2544, 5, 5, "INT_SHOP", "shop_loop"}, // (83) Actor Pizza Steck 4 Koch (Espalande North San Fierro)
{155, 372.5408, -113.7303, 1001.4922, 353.9679, 5, 5, "INT_SHOP", "shop_loop"}, // (84) Actor Pizza Steck 5 Koch (Espalande North San Fierro){155, 372.6779, -117.2779, 1001.4922, 182.0592, 6, 5, "DEALER", "DEALER_IDLE"}, // (85) Actor Pizza Steck 1 (Financial San Fierro)
{155, 374.7041, -117.2758, 1001.4922, 182.9616, 6, 5, "DEALER", "DEALER_IDLE"}, // (86) Actor Pizza Steck 2 (Financial San Fierro)
{155, 376.6478, -117.2785, 1001.4922, 183.3000, 6, 5, "DEALER", "DEALER_IDLE"}, // (87) Actor Pizza Steck 3 (Financial San Fierro)
{155, 374.8322, -113.6196, 1001.4922, 358.2544, 6, 5, "INT_SHOP", "shop_loop"}, // (88) Actor Pizza Steck 4 Koch (Financial San Fierro)
{155, 372.5408, -113.7303, 1001.4922, 353.9679, 6, 5, "INT_SHOP", "shop_loop"}, // (89) Actor Pizza Steck 5 Koch (Financial San Fierro){56, 159.7391, -81.1912, 1001.8120, 182.5511, 7, 18, "COP_AMBIENT", "Coplook_think"}, // (90) Actor Zip 1 (Emerald Isle)
{55, 162.7839, -81.1884, 1001.8047, 182.5511, 7, 18, "COP_AMBIENT", "Coplook_loop"}, // (91) Actor Zip 2 (Emerald Isle){56, 159.7391, -81.1912, 1001.8120, 182.5511, 8, 18, "COP_AMBIENT", "Coplook_watch"}, // (92) Actor Zip 1 (Downtown San Fierro)
{55, 162.7839, -81.1884, 1001.8047, 182.5511, 8, 18, "COP_AMBIENT", "Coplook_think"}, // (93) Actor Zip 2 (Downtown San Fierro){56, 159.7391, -81.1912, 1001.8120, 182.5511, 9, 18, "COP_AMBIENT", "Coplook_think"}, // (94) Actor Zip 1 (Downtown Los Santos)
{55, 162.7839, -81.1884, 1001.8047, 182.5511, 9, 18, "COP_AMBIENT", "Coplook_loop"}, // (95) Actor Zip 2 (Downtown Los Santos){93, 206.3891, -98.7054, 1005.2578, 180.5566, 0, 15, "COP_AMBIENT", "Coplook_think"}, // (96) Actor Binco 1 (Ganton)
{119, 208.8716, -98.7052, 1005.2578, 179.0902, 0, 15, "COP_AMBIENT", "Coplook_watch"}, // (97) Actor Binco 2 (Ganton){93, 206.3891, -98.7054, 1005.2578, 180.5566, 1, 15, "COP_AMBIENT", "Coplook_loop"}, // (98) Actor Binco 1 (Creek)
{119, 208.8716, -98.7052, 1005.2578, 179.0902, 1, 15, "COP_AMBIENT", "Coplook_think"}, // (99) Actor Binco 2 (Creek){93, 206.3891, -98.7054, 1005.2578, 180.5566, 2, 15, "COP_AMBIENT", "Coplook_think"}, // (100) Actor Binco 1 (Emerald Isle)
{119, 208.8716, -98.7052, 1005.2578, 179.0902, 2, 15, "COP_AMBIENT", "Coplook_loop"}, // (101) Actor Binco 2 (Emerald Isle){93, 206.3891, -98.7054, 1005.2578, 180.5566, 3, 15, "COP_AMBIENT", "Coplook_watch"}, // (102) Actor Binco 1 (Jefferson)
{119, 208.8716, -98.7052, 1005.2578, 179.0902, 3, 15, "COP_AMBIENT", "Coplook_think"}, // (103) Actor Binco 2 (Jefferson){93, 206.3891, -98.7054, 1005.2578, 180.5566, 4, 15, "COP_AMBIENT", "Coplook_loop"}, // (104) Actor Binco 1 (Las Venturas Airport)
{119, 208.8716, -98.7052, 1005.2578, 179.0902, 4, 15, "COP_AMBIENT", "Coplook_think"}, // (105) Actor Binco 2 (Las Venturas Airport){148, 204.8535, -7.9837, 1001.2109, 270.8226, 5, 5, "COP_AMBIENT", "Coplook_think"}, // (106) Actor Victim (Rodeo)
{148, 204.8535, -7.9837, 1001.2109, 270.8226, 6, 5, "COP_AMBIENT", "Coplook_watch"}, // (107) Actor Victim (Downtown San Fierro){156, -27.9641, -186.8378, 1003.5469, 2.3730, 0, 17, "BAR", "Barserve_loop"}, // (108) Actor 24/7 (Noob Spawn)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 1, 17, "BAR", "Barserve_loop"}, // (109) Actor 24/7 (Idleewood Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 2, 17, "DEALER", "DEALER_IDLE"}, // (110) Actor 24/7 (Mullholland Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 3, 17, "COP_AMBIENT", "Coplook_loop"}, // (111) Actor 24/7 (Flint County Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 4, 17, "BAR", "Barserve_loop"}, // (112) Actor 24/7 (Whetstone Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 5, 17, "DEALER", "DEALER_IDLE"}, // (113) Actor 24/7 (Starfish Casino)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 6, 17, "COP_AMBIENT", "Coplook_loop"}, // (114) Actor 24/7 (Emerald Isle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 7, 17, "BAR", "Barserve_loop"}, // (115) Actor 24/7 (Creek)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 8, 17, "DEALER", "DEALER_IDLE"}, // (116) Actor 24/7 (Starfish Casino)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 9, 17, "BAR", "Barserve_loop"}, // (117) Actor 24/7 (Old Venturas Strip)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 10, 17, "BAR", "Barserve_loop"}, // (118) Actor 24/7 (Come-A-Lot Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 11, 17, "DEALER", "DEALER_IDLE"}, // (119) Actor 24/7 (Stadthalle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 12, 17, "BAR", "Barserve_loop"}, // (120) Actor 24/7 (Easter Basin Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 13, 17, "DEALER", "DEALER_IDLE"}, // (121) Actor 24/7 (Juniper Hollow Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 14, 17, "COP_AMBIENT", "Coplook_loop"}, // (122) Actor 24/7 (Emerals Isle Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 15, 17, "DEALER", "DEALER_IDLE"}, // (123) Actor 24/7 (Spinybed Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 16, 17, "COP_AMBIENT", "Coplook_loop"}, // (124) Actor 24/7 (Redsands West Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 17, 17, "BAR", "Barserve_loop"}, // (125) Actor 24/7 (The Strip Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 18, 17, "DEALER", "DEALER_IDLE"}, // (126) Actor 24/7 (Bone County Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 19, 17, "BAR", "Barserve_loop"}, // (127) Actor 24/7 (Tierra Robada Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 20, 17, "DEALER", "DEALER_IDLE"}, // (128) Actor 24/7 (Tierra Robada 2 Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 21, 17, "BAR", "Barserve_loop"}, // (129) Actor 24/7 (Montgomery Tankstelle)
{156, -27.9641, -186.8378, 1003.5469, 2.3730, 22, 17, "BAR", "Barserve_loop"}, // (130) Actor 24/7 (BSN){121, 296.6663, -40.2158, 1001.5156, 354.3737, 0, 1, "HAIRCUTS", "BRB_Loop"}, // (131) Actor Ammu LS
{191, 297.5566, -82.5296, 1001.5156, 358.5148, 0, 4, "HAIRCUTS", "BRB_Loop"}, // (132) Actor Ammu SF
{30, 288.0091, -111.5139, 1001.5156, 1.9722, 0, 6, "HAIRCUTS", "BRB_Loop"}, // (133) Actor Ammu LV{63, 501.8481, -18.5108, 1000.6719, 84.4462, 1, 17, "DEALER", "DEALER_IDLE"}, // (134) Actor Alhambra Bar 1
{64, 501.8482, -21.4040, 1000.6797, 81.8518, 1, 17, "DEALER", "DEALER_IDLE"}, // (135) Actor Alhambra Bar 2
{63, 501.8499, -23.3330, 1000.6797, 87.6047, 1, 17, "DEALER", "DEALER_IDLE"}, // (136) Actor Alhambra Bar 3
{64, 502.6075, -17.0562, 1000.6797, 359.7935, 1, 17, "DEALER", "DEALER_IDLE"}, // (137) Actor Alhambra Bar 4
{143, 484.5988, -10.7479, 1000.6797, 241.1269, 1, 17, "DANCING", "dance_loop"}, // (138) Alhambra Tänzer 1
{75, 485.7194, -12.4375, 1000.6797, 36.1157, 1, 17, "DANCING", "DAN_Up_A"}, // (139) Alhambra Tänzer 2
{170, 487.7484, -11.0957, 1000.6797, 193.6530, 1, 17, "DANCING", "dnce_M_a"}, // (140) Alhambra Tänzer 3
{214, 490.4490, -11.0397, 1000.6797, 189.0129, 1, 17, "DANCING", "dance_loop"}, // (141) Alhambra Tänzer 4
{226, 490.0938, -14.3486, 1000.6797, 6.2752, 1, 17, "DANCING", "dance_loop"}, // (142) Alhambra Tänzer 5
{250, 488.6413, -14.0198, 1000.6797, 48.4628, 1, 17, "DANCING", "DAN_Up_A"}, // (143) Alhambra Tänzer 6
{214, 486.0331, -15.9962, 1000.6797, 138.3652, 1, 17, "DANCING", "dance_loop"}, // (144) Alhambra Tänzer 7
{226, 484.4335, -17.5344, 1000.6797, 310.0485, 1, 17, "DANCING", "dance_loop"}, // (145) Alhambra Tänzer 8
{185, 491.0544, -17.4264, 1000.6797, 34.7621, 1, 17, "DANCING", "dnce_M_a"}, // (146) Alhambra Tänzer 9
{216, 489.3320, -14.6829, 1000.6797, 212.0854, 1, 17, "DANCING", "dance_loop"}, // (147) Alhambra Tänzer 10
{244, 485.3198, -2.5103, 1002.3828, 183.7206, 1, 17, "DANCING", "DAN_Up_A"}, // (148) Alhambra Tänzer Bühne 1
{152, 487.6667, -2.8841, 1002.3828, 184.9614, 1, 17, "DANCING", "dnce_M_a"}, // (149) Alhambra Tänzer Bühne 2
{246, 490.3432, -2.4274, 1002.3828, 180.9007, 1, 17, "DANCING", "dance_loop"}, // (150) Alhambra Tänzer Bühne 3{257, -2655.5073, 1412.2668, 906.2734, 274.7957, 1, 3, "DEALER", "DEALER_IDLE"}, // (151) Plasure Domes Bar 1
{63, -2656.5728, 1413.9594, 906.2734, 352.2900, 1, 3, "BAR", "Barserve_loop"}, // (152) Plasure Domes Bar 2
{244, -2661.9370, 1413.9575, 906.2734, 358.1557, 1, 3, "DEALER", "DEALER_IDLE"}, // (153) Plasure Domes Bar 3
{257, -2662.8403, 1412.9463, 906.2734, 86.4789, 1, 3, "DEALER", "DEALER_IDLE"}, // (154) Plasure Domes Bar 4
{244, -2662.8411, 1407.5396, 906.2734, 89.6373, 1, 3, "BAR", "Barserve_loop"}, // (155) Plasure Domes Bar 5
{63, -2661.6763, 1406.6729, 906.2734, 174.6893, 1, 3, "DEALER", "DEALER_IDLE"}, // (156) Plasure Domes Bar 6
{257, -2656.2397, 1406.6697, 906.2734, 174.2381, 1, 3, "BAR", "Barserve_loop"}, // (157) Plasure Domes Bar 7
{63, -2655.5098, 1407.6342, 906.2734, 269.6678, 1, 3, "DEALER", "DEALER_IDLE"}, // (158) Plasure Domes Bar 8
{138, -2663.6997, 1410.2047, 907.3886, 91.1646, 1, 3, "STRIP", "strip_G"}, // (159) Plasure Domes Tänzerin Bar 1
{87, -2659.0503, 1414.7928, 907.3886, 11.6399, 1, 3, "STRIP", "strip_D"}, // (160) Plasure Domes Tänzerin Bar 2
{138, -2654.5574, 1410.2767, 907.3886, 272.8262, 1, 3, "STRIP", "strip_G"}, // (161) Plasure Domes Tänzerin Bar 3
{87, -2659.1650, 1405.8060, 907.3886, 187.9998, 1, 3, "STRIP", "strip_D"}, // (162) Plasure Domes Tänzerin Bar 4
{138, -2654.3130, 1427.0376, 907.3604, 7.6919, 1, 3, "STRIP", "strip_G"}, // (163) Plasure Domes Tänzerin 1
{139, -2660.6980, 1427.0234, 907.3604, 8.4205, 1, 3, "STRIP", "strip_A"}, // (164) Plasure Domes Tänzerin 2
{140, -2670.6094, 1427.6897, 907.3604, 45.1936, 1, 3, "STRIP", "strip_G"}, // (165) Plasure Domes Tänzerin 3
{152, -2673.5247, 1428.0032, 906.4609, 151.6320, 1, 3, "STRIP", "strip_D"}, // (166) Plasure Domes Tänzerin 4
{138, -2666.8552, 1428.2444, 906.4609, 320.7057, 1, 3, "STRIP", "strip_G"}, // (167) Plasure Domes Tänzerin 5
{139, -2677.5527, 1414.3967, 907.5742, 273.1036, 1, 3, "STRIP", "strip_D"}, // (168) Plasure Domes Tänzerin 6
{140, -2678.0518, 1410.6239, 907.5703, 258.8905, 1, 3, "STRIP", "strip_A"}, // (169) Plasure Domes Tänzerin 7
{87, -2677.5845, 1406.5649, 907.5703, 271.7498, 1, 3, "STRIP", "strip_D"}, // (170) Plasure Domes Tänzerin 8
{138, -2677.8794, 1402.5856, 907.5703, 276.7130, 1, 3, "STRIP", "strip_G"}, // (171) Plasure Domes Tänzerin 9
{139, -2672.8799, 1411.3152, 907.5703, 5.3747, 1, 3, "STRIP", "strip_D"}, // (172) Plasure Domes Tänzerin 10
{140, -2672.6719, 1409.2668, 907.5703, 173.8384, 1, 3, "STRIP", "strip_A"}, // (173) Plasure Domes Tänzerin 11
{87, -2670.1746, 1410.4575, 907.5703, 268.7042, 1, 3, "STRIP", "strip_G"} // (174) Plasure Domes Tänzerin 12
};OnGameModeInit
for(new i=0; i<MAX_ACTORS; i++)
{
Actor[i] = CreateActor(ActorDatei[i][ActorModelID], ActorDatei[i][ActorX], ActorDatei[i][ActorY], ActorDatei[i][ActorZ], ActorDatei[i][ActorRotation]);
SetActorVirtualWorld(Actor[i], ActorDatei[i][ActorVirtualWorld]);
ApplyActorAnimation(Actor[i], ActorDatei[i][ActorAnimLib], ActorDatei[i][ActorAnimName], 4.1, 1, 0, 0, 0, 0);
}OnGameModeExit
for(new i=0; i>MAX_ACTORS; i++)
{
DestroyActor(Actor[i]);
}
#define MAX_OPEN (68)enum OpenInteriors
{
Float:OpenEingangX,
Float:OpenEingangY,
Float:OpenEingangZ,
Float:OpenAusgangX,
Float:OpenAusgangY,
Float:OpenAusgangZ,
OpenInteriorID,
OpenInteriorVirtual
};new const OpenInteriorsInfo[MAX_OPEN][OpenInteriors] = {
{1836.41, -1682.57, 13.349, 493.62, -24.4723, 1000.68, 17, 0}, //Alhambra
{-2624.55, 1412.36, 7.0938, -2636.53, 1402.63, 906.461, 3, 0},//Pleasure Domes
{1367.87, -1279.86, 13.5469, 286.149, -40.6444, 1001.52, 1, 0},//Ammu LS
{-2626.69, 208.889, 4.5948, 285.592, -86.0301, 1001.52, 4, 0},//Ammu SF
{2158.83, 943.151, 10.8203, 296.637, -111.501, 1001.52, 6, 0},//Ammu LV
{1554.9116, -1675.4540, 16.1953, 246.783996, 63.900199, 1003.640625, 6, 0},//LSPD Eingang
{1525.6305, -1677.7211, 5.8906, 246.4299, 88.0091, 1003.6406, 6, 0},//LSPD Garage
{1572.2103, -1636.4850, 13.5578, 1563.4890, -1666.7212, 28.3956, 0, 0},//LSPD Dach
{-1605.5992, 711.1667, 13.8672, 246.3578, 107.5715, 1003.2188, 10, 0},//SAPD Eingang
{-1606.3939, 672.4710, -5.2422, 215.3691, 126.3465, 1003.2188, 10, 0},//SAPD Garage
{1833.4132, -1842.6372, 13.3934, -25.8406, -187.6714, 1003.5469, 17, 0}, // 24/7 LS Bahnhof
{1929.2400, -1776.2889, 13.3934,-25.8406, -187.6714, 1003.5469, 17, 1}, // 24/7 Idleewood Tankstelle
{999.9698, -920.0452, 42.3281, -25.8406, -187.6714, 1003.5469, 17, 2}, // 24/7 Mullholland Tankstelle
{-78.6431, -1169.8074, 2.1424, -25.8406, -187.6714, 1003.5469, 17, 3}, // 24/7 Flint County Tankstelle
{-1562.4082, -2733.1560, 48.7435, -25.8406, -187.6714, 1003.5469, 17, 4}, // 24/7 Whetstone Tankstelle
{2194.4885, 1990.9581, 12.2969, -25.8406, -187.6714, 1003.5469, 17, 5}, // 24/7 Starfish Casino
{2097.6875, 2224.2371, 11.0234, -25.8406, -187.6714, 1003.5469, 17, 6}, // 24/7 Emerald Isle
{2884.7900, 2453.6396, 11.0690, -25.8406, -187.6714, 1003.5469, 17, 7}, // 24/7 Creek
{2546.4626, 1971.9843, 10.8203, -25.8406, -187.6714, 1003.5469, 17, 8}, // 24/7 Starfish Casino
{2452.3582, 2064.7256, 10.8203, -25.8406, -187.6714, 1003.5469, 17, 9}, // 24/7 Old Venturas Strip
{2637.2122, 1129.2606, 11.1797, -25.8406, -187.6714, 1003.5469, 17, 10}, // 24/7 Come-A-Lot Tankstelle
{1352.4924, -1758.8451, 13.5078, -25.8406, -187.6714, 1003.5469, 17, 11}, // 24/7 Stadthalle
{-1676.0979, 432.0437, 7.1797, -25.8406, -187.6714, 1003.5469, 17, 12}, // 24/7 Easter Basin Tankstelle
{-2420.1526, 969.8209, 45.2969, -25.8406, -187.6714, 1003.5469, 17, 13}, // 24/7 Juniper Hollow Tankstelle
{2188.0325, 2469.6150, 11.2422, -25.8406, -187.6714, 1003.5469, 17, 14}, // 24/7 Emerals Isle Tankstelle
{2150.7471, 2734.0337, 11.1763, -25.8406, -187.6714, 1003.5469, 17, 15}, // 24/7 Spinybed Tankstelle
{1599.2450, 2221.7290, 11.0625, -25.8406, -187.6714, 1003.5469, 17, 16}, // 24/7 Redsands West Tankstelle
{2117.5227, 896.7756, 11.1797, -25.8406, -187.6714, 1003.5469, 17, 17}, // 24/7 The Strip Tankstelle
{663.0126, 1716.5026, 7.1875, -25.8406, -187.6714, 1003.5469, 17, 18}, // 24/7 Bone County Tankstelle
{-1271.6030, 2713.2217, 50.2663, -25.8406, -187.6714, 1003.5469, 17, 19}, // 24/7 Tierra Robada Tankstelle
{-1465.7823, 1873.4202, 32.6328, -25.8406, -187.6714, 1003.5469, 17, 20}, // 24/7 Tierra Robada 2 Tankstelle
{1383.1257, 465.3380, 20.1948, -25.8406, -187.6714, 1003.5469, 17, 21}, // 24/7 Montgomery Tankstelle
{2244.4226, -1665.0626, 15.4766, 207.7523, -111.0303, 1005.1328, 15, 0}, // Ganton Binco
{2861.3064, 2430.7085, 11.0690, 207.7523, -111.0303, 1005.1328, 15, 1}, // Creek Binco
{2102.2195, 2257.3752, 11.0234, 207.7523, -111.0303, 1005.1328, 15, 2}, // Emerald Isle Binco
{2112.8276, -1212.0350, 23.9637, 207.7523, -111.0303, 1005.1328, 15, 3}, // Jefferson Binco
{1656.6327, 1733.3412, 10.8281, 207.7523, -111.0303, 1005.1328, 15, 4}, // Las Venturas Airport Binco
{461.1960, -1500.8562, 31.0593, 227.2287, -8.1683, 1002.2109, 5, 5}, // Rodeo Victim
{-1694.5387, 950.7520, 24.8906, 227.2287, -8.1683, 1002.2109, 5, 6}, // Downtown San Fierro Victim
{2090.4067, 2224.2866, 11.0234, 161.4139, -96.8216, 1001.8047, 18, 7}, // Emerald Isle Zip
{-1882.4608, 866.2303, 35.1719, 161.4139, -96.8216, 1001.8047, 18, 8}, // Downtown San Fierro Zip
{1457.3076, -1137.4480, 23.9657, 161.4139, -96.8216, 1001.8047, 18, 9}, // Downtown Los Santos Zip
{2104.8557, -1806.4862, 13.3934, 372.3584, -133.0832, 1001.4922, 5, 0}, // Idleewood Pizza
{2332.2166, 74.9827, 26.6210, 372.3584, -133.0832, 1001.4922, 5, 1}, // Palomino Creek Pizza
{1367.2854, 248.4236, 19.5669, 372.3584, -133.0832, 1001.4922, 5, 2}, // Montgomery Pizza
{203.5421, -202.4460, 1.5781, 372.3584, -133.0832, 1001.4922, 5, 3}, // Blueberry Pizza
{2083.3149, 2224.0027, 11.0234, 372.3584, -133.0832, 1001.4922, 5, 4}, // Emerald Isle Pizza
{-1720.9486, 1359.7400, 7.1853, 372.3584, -133.0832, 1001.4922, 5, 5}, // Espalande North San Fierro Pizza
{-1808.4294, 945.5788, 24.8906, 372.3584, -133.0832, 1001.4922, 5, 6}, // Financial San Fierro Pizza
{928.3748, -1352.8358, 13.3438, 364.8388, -11.4912, 1001.8516, 9, 0}, // Market Cluckin Bell
{-1816.5310, 618.4895, 35.1719, 364.8388, -11.4912, 1001.8516, 9, 1}, // Downtown San Fierro Cluckin Bell
{2397.7275, -1898.7258, 13.5469, 364.8388, -11.4912, 1001.8516, 9, 2}, // Willowfield Cluckin Bell
{-1213.4275, 1830.5964, 41.9297, 364.8388, -11.4912, 1001.8516, 9, 3}, // Tierra Robada Cluckin Bell
{2420.0740, -1508.9742, 24.0000, 364.8388, -11.4912, 1001.8516, 9, 4}, // East Los Santos Cluckin Bell
{2393.2778, 2041.8110, 10.8203, 364.8388, -11.4912, 1001.8516, 9, 5}, // Old Venturas Strip Cluckin Bell
{2838.3022, 2407.4683, 11.0690, 364.8388, -11.4912, 1001.8516, 9, 6}, // Creek Cluckin Bell
{172.6606, 1176.6274, 14.7645, 364.8388, -11.4912, 1001.8516, 9, 7}, // Bone County Cluckin Bell
{2638.1880, 1671.9564, 11.0234, 364.8388, -11.4912, 1001.8516, 9, 8}, // Pilgrim Cluckin Bell
{2102.4355, 2228.7559, 11.0234, 364.8388, -11.4912, 1001.8516, 9, 9}, // Emerald Isle Cluckin Bell
{-2155.0603, -2460.3020, 30.8516, 364.8388, -11.4912, 1001.8516, 9, 10}, // Angel Pine Cluckin Bell
{1199.9180, -918.6084, 43.1153, 363.0526, -74.9714, 1001.5078, 10, 0}, // BSN
{811.0704, -1616.0961, 13.5469, 363.0526, -74.9714, 1001.5078, 10, 1}, // Marina Burger Shot
{-2336.6326, -166.8775, 35.5547, 363.0526, -74.9714, 1001.5078, 10, 2}, // Garcia Burger Shot
{1872.5382, 2071.7246, 11.0625, 363.0526, -74.9714, 1001.5078, 10, 3}, // Redsands East Burger Shot
{-1912.3461, 828.0004, 35.2243, 363.0526, -74.9714, 1001.5078, 10, 4}, // Downtown San Fierro Burger Shot
{2472.3828, 2034.1818, 11.0625, 363.0526, -74.9714, 1001.5078, 10, 5}, // Old Venturas Strip Burger Shot
{2169.7561, 2795.9231, 10.8203, 363.0526, -74.9714, 1001.5078, 10, 6}, // Spinybed Burger Shot
{1158.2513, 2072.1287, 11.0625, 363.0526, -74.9714, 1001.5078, 10, 7} // Whitewood Estates Burger Shot
};OnGameModeInit
for(new i=0;i<MAX_OPEN;i++)
{
CreatePickup(1318, 1, OpenInteriorsInfo[i][OpenEingangX], OpenInteriorsInfo[i][OpenEingangY], OpenInteriorsInfo[i][OpenEingangZ], 0);
CreatePickup(1318, 1, OpenInteriorsInfo[i][OpenAusgangX], OpenInteriorsInfo[i][OpenAusgangY], OpenInteriorsInfo[i][OpenAusgangZ], OpenInteriorsInfo[i][OpenInteriorVirtual]);
}OnPlayerKeyStateChange
if(newkeys & KEY_SECONDARY_ATTACK)
{
for(new i=0; i<MAX_OPEN; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.5, OpenInteriorsInfo[i][OpenEingangX], OpenInteriorsInfo[i][OpenEingangY], OpenInteriorsInfo[i][OpenEingangZ]))//Eingang
{
SetPlayerVirtualWorld(playerid, OpenInteriorsInfo[i][OpenInteriorVirtual]);
SetPlayerInterior(playerid, OpenInteriorsInfo[i][OpenInteriorID]);
SetPlayerPos(playerid, OpenInteriorsInfo[i][OpenAusgangX], OpenInteriorsInfo[i][OpenAusgangY], OpenInteriorsInfo[i][OpenAusgangZ]);
break;
}
if(IsPlayerInRangeOfPoint(playerid, 1.5, OpenInteriorsInfo[i][OpenAusgangX], OpenInteriorsInfo[i][OpenAusgangY], OpenInteriorsInfo[i][OpenAusgangZ]) && GetPlayerVirtualWorld(playerid) == OpenInteriorsInfo[i][OpenInteriorVirtual])//Ausgang
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, OpenInteriorsInfo[i][OpenEingangX], OpenInteriorsInfo[i][OpenEingangY], OpenInteriorsInfo[i][OpenEingangZ]);
break;
}
}
}Gruß:
ZeusLukas -
Hier drei String-Funktionen, um einen String umzudrehen, zu mixen oder einen zufälligen String zu erstellen:
Hinweis:
Für alle drei Funktionen wird einmalig unter den Includes folgende Definition benötigt:strreverse:
Ein String wird umgedreht zurückgegeben.Cstock strreverse(str[]) { new len = strlen(str), tmp[MAX_STR], j; for(new i = len-1; i >= 0; i--) { tmp[j] = str[i]; j++; } return tmp; }
Beispiel:
Ausgabe:
Zitat[14/11/2015 12:15:19] fedcba
strmix:
Ein String wird zufällig gemixt zurückgegeben.C
Alles anzeigenstock strmix(str[]) { new tmp[MAX_STR], tmp2[MAX_STR], len, j, n; strcat(tmp, str); while((len=strlen(tmp))) { n = random(len); tmp2[j] = tmp[n]; strdel(tmp, n, n+1); j++; } return tmp2; }
Beispiel:
Ausgabe:
Zitat[14/11/2015 12:17:18] dcbaef
randstr:
Es wird ein zufälliger String der Länge x zurückgegeben.C
Alles anzeigenstock randstr(len) { static const chars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; new tmp[MAX_STR], i; if(len > MAX_STR) len = MAX_STR; for(i = 0; i < len; i++) { tmp[i] = chars[random(sizeof(chars))]; } return tmp; }
Beispiel:
Ausgabe:
Zitat[14/11/2015 12:19:12] Wyf2P92RNN
-
-
lässt sich von selbst erklären
C
Alles anzeigenstock ConvertIntToString(int, s[]){ #define DECIMAL_SYMBOL "." valstr(s, int); if(strlen(s) <= 3) return 1; for(new a = strlen(s); a >= 0; a -= 3){ if(a == 0) break; strins(s, DECIMAL_SYMBOL, a, 24); } strdel(s, strlen(s) -1, strlen(s)); return 1; #undef DECIMAL_SYMBOL }
Beispiel: -
lässt sich von selbst erklären
Also dein Code hat noch optimierungs potenzialCodestock ConvertIntToString(val, string[]){ valstr(string, val); for(new i = strlen(string)-1; i >= 3;) { i-= 2; strins(string, ".", i--, 1); } return 1; }
Dein #undef DECIMAL_SYMBOL kannst du dir sparen, das würdest du nur brauchen falls du dasselbe Define nur mit einem anderen Inhalt nochmal im Code verwenden würdest
//edit
Paar nützliche Funktionen//edit neue Funktion
Mit dieser Position kann man durch Winkel die Kamera via SetPlayerCameraPos setzenCodestock SetPlayerCameraLookAtEx(playerid, Float:X, Float:Y, Float:Z, Float:RotX, Float:RotZ) { SetPlayerCameraPos(playerid, X, Y, Z); X += 10.0 * floatcos(RotX, degrees) * floatcos(RotZ, degrees); Y += 10.0 * floatcos(RotX, degrees) * floatsin(RotZ, degrees); Z += 10.0 * floatsin(RotX, degrees); SetPlayerCameraLookAt(playerid, X, Y, Z); return 1; }
Code
Alles anzeigenstock GetAttachDynamicObjectOffset(objectID, &Float:offsetx, &Float:offsety, &Float:offsetz, &Float:rx, &Float:ry, &Float:rz) { if(!IsValidDynamicObject(objectID))return 0; Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectID, E_STREAMER_ATTACH_OFFSET_X,offsetx); Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectID, E_STREAMER_ATTACH_OFFSET_Y,offsety); Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectID, E_STREAMER_ATTACH_OFFSET_Z,offsetz); Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectID, E_STREAMER_ATTACH_R_X,rx); Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectID, E_STREAMER_ATTACH_R_Y,ry); Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectID, E_STREAMER_ATTACH_R_Z,rz); return 1; } stock GetAttachDynamicObjectPos(objectID, vehicleid, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz) { if(!IsValidDynamicObject(objectID))return 0; new Float:vX, Float:vY, Float:vZ, Float:vRot; GetVehiclePos(vehicleid,vX,vY,vZ); GetVehicleZAngle(vehicleid,vRot); GetAttachDynamicObjectOffset(objectID, x, y, z, rx, ry, rz); vX = (floatsin(360-vRot,degrees) * y + floatcos(360-vRot,degrees) * x) + vX; vY = (floatcos(360-vRot,degrees) * y - floatsin(360-vRot,degrees) * x) + vY; x = vX; y = vY; z += vZ; rz += vRot; return 1; }
-
Beitrag von malE ()
Dieser Beitrag wurde vom Autor aus folgendem Grund gelöscht: Mein Fehler gewesen, funktioniert super! Good Job IPrototypeI (). -
Die Funktion ist nicht fehlerhaft den sie berechnet den SetPlayerCameraLookAt ausgehend von der Rotation in einer Distanz von 10 Units , ich habe die Funktion davor selbst getestet und sie funktioniert wie sie soll
-
Auf Nachfrage von @[LnD]JustMe.77 habe ich mir gedacht ich schreibe das kurz für den DIALOG_STYLE_MSGBOX zusammen und poste es hier, falls mal wieder jemand danach sucht bzw. jemand es benötigt.
Externer Inhalt www.youtube.comInhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.Durch die Aktivierung der externen Inhalte erklären Sie sich damit einverstanden, dass personenbezogene Daten an Drittplattformen übermittelt werden. Mehr Informationen dazu haben wir in unserer Datenschutzerklärung zur Verfügung gestellt.Unter den Includes die Variablen sowie der Hook für die Dialoge:
#define DIALOG_TEST 1337
new testCount[MAX_PLAYERS];new pDialog[MAX_PLAYERS] = {-1,...};
stock my_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]) //©Jeffry
{
if(!IsPlayerConnected(playerid)) return 0;
pDialog[playerid] = dialogid;
ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
return 1;
}#if defined _ALS_ShowPlayerDialog
#undef ShowPlayerDialog
#else
#define _ALS_ShowPlayerDialog
#endif
#define ShowPlayerDialog my_ShowPlayerDialogBei OnFilterScriptInit/OnGameModeInit:
SetTimer("ReshowDialog", 460, true);Bei OnPlayerDisconnect:
pDialog[playerid] = -1;Hier einen Test-Befehl für OnPlayerCommandText:
if(!strcmp(cmdtext, "/dialog", true))
{
testCount[playerid] = gettime();
ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", "Du hast diesen Dialog offen seit: 00:00", "Ok", "Abbrechen");
return 1;
}Dann der Teil zu OnDialogResponse:
//Ganz oben als erstes in OnDialogResponse:
pDialog[playerid] = -1;
Sowie:if(dialogid == DIALOG_TEST)
{
if(response)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Hallo Welt!");
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Hallo Welt!");
}
return 1;
}Und dann ganz unten im Filterscript/Gamemode:
forward ReshowDialog();
public ReshowDialog()
{
new str[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pDialog[i] == -1) continue;
if(pDialog[i] == DIALOG_TEST)
{
new t = gettime() - testCount[i];
format(str, sizeof(str), "Du hast diesen Dialog offen seit: %02d:%02d", t/60, t%60);
ShowPlayerDialog(i, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", str, "Ok", "Abbrechen");
}
//andere Dialoge...
}
return 1;
}Oder alternativ hier das ganze als kompletten Filterscript:
#include <a_samp>
#define DIALOG_TEST 1337
new testCount[MAX_PLAYERS];new pDialog[MAX_PLAYERS] = {-1,...};
stock my_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]) //©Jeffry
{
if(!IsPlayerConnected(playerid)) return 0;
pDialog[playerid] = dialogid;
ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
return 1;
}#if defined _ALS_ShowPlayerDialog
#undef ShowPlayerDialog
#else
#define _ALS_ShowPlayerDialog
#endif
#define ShowPlayerDialog my_ShowPlayerDialogpublic OnPlayerDisconnect(playerid, reason)
{
pDialog[playerid] = -1;
return 1;
}public OnFilterScriptInit()
{
SetTimer("ReshowDialog", 460, true);
return 1;
}public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/dialog", true))
{
testCount[playerid] = gettime();
ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", "Du hast diesen Dialog offen seit: 00:00", "Ok", "Abbrechen");
return 1;
}
return 0;
}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
//Ganz oben:
pDialog[playerid] = -1;//...
if(dialogid == DIALOG_TEST)
{
if(response)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Hallo Welt!");
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Hallo Welt!");
}
return 1;
}//...
return 0;
}forward ReshowDialog();
public ReshowDialog()
{
new str[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pDialog[i] == -1) continue;
if(pDialog[i] == DIALOG_TEST)
{
new t = gettime() - testCount[i];
format(str, sizeof(str), "Du hast diesen Dialog offen seit: %02d:%02d", t/60, t%60);
ShowPlayerDialog(i, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", str, "Ok", "Abbrechen");
}
//andere Dialoge...
}
return 1;
} -
Dieser Codedchnipsel ist z.B für Roleplay oder Reallife Server ganz nützlich. Hierbei handelt es sich um ein Vor- & Nachnamen System.
Beispiel: German_ScripterHD --> Vorname: German Nachname: ScripterHD
Cmain() { new rpName[MAX_PLAYER_NAME]="Bread_Fish",RP_PlayerName[2][128]; if(strfind(rpName, "_", true) == -1)return print("Fehler! Kein Unterstrich!"); split(rpName, RP_PlayerName, '_'); printf("Vorname: %s | Nachname: %s",RP_PlayerName[0],RP_PlayerName[1]); return 1; }
print:
MfG
-
-
Ob das jetzt performanter ist, keine Ahnung. (Würde sowas auch mit sscanf machen)
Die Beschränkung auf 10 Zeichen für Vorname und Nachname find ich nicht so gut.
Je nachdem ob mein Vor- bzw Nachname mehr als 10 Zeichen hat, wird der Rest abgeschnitten. Da der Name sowieso nie länger als MAX_PLAYER_NAME sein kann, würde ich eher das als Größe für Vor- und Nachname nehmen. Lieber auf Nummer sicher gehen. ( Wobei 128 für beides definitiv zu groß ist :P, Siehe https://breadfish.de/index.php?thread/18-n%C3%BCtzliche-codeschnipsel/&postID=2166483#post2166483)Beispiel:
Markus_Hildebrandtname[0] = "Markus"
name[1] = "Hildebran" -
Ob das jetzt performanter ist, keine Ahnung. (Würde sowas auch mit sscanf machen)
Die Beschränkung auf 10 Zeichen für Vorname und Nachname find ich nicht so gut.
Je nachdem ob mein Vor- bzw Nachname mehr als 10 Zeichen hat, wird der Rest abgeschnitten. Da der Name sowieso nie länger als MAX_PLAYER_NAME sein kann, würde ich eher das als Größe für Vor- und Nachname nehmen. Lieber auf Nummer sicher gehen. ( Wobei 128 für beides definitiv zu groß ist :P, Siehe https://breadfish.de/index.php?thread/18-n%C3%BCtzliche-codeschnipsel/&postID=2166483#post2166483)Beispiel:
Markus_Hildebrandtname[0] = "Markus"
name[1] = "Hildebran"- Ich glaub es sollte an sich performanter sein , klar natives sind schnell und das sscanf plugin hat beim Aufruf auch einiges zu tun aber an sich vergleiche ich das mal mit dem Aufruf der natives, welche sich bei einem Durchlauf auf 1 + 3 * 2 handelt. Also über den Daumen gepeilt behaupte ich das einfach mal. Zusätzlich kann man sagen ist definitiv via sscanf übersichtlicher und weniger Code zum schreiben. Zu dem Punkt mit 10 Zeichen, das war eher als Beispiel gedacht dennoch danke für die Anmerkung ^^.
-
Nützlich für zum bsp /timeban oder auch für die dauer des Donater Ranges:
stock GetSecondsByTimeString(string[], type[4]="hms", bool:ignorecase=true) //bsp: 45h32m10s oder 1y30m5d
{
new time=0, var[32], years, months, days, hours, mins, secs, pos;
if(!strcmp(type, "hms", ignorecase)) //bsp: 5h30m15s (5 Stunden & 30 Minuten & 15 Sekunden)
{
for (new i, l = strlen(string); i != l; i++)
{
if(string[i] == 'h' || (ignorecase && string[i] == 'H'))
{
strmid(var, string, 0, i);
hours = strval(var)*3600;
pos = i;
continue;
}
if(string[i] == 'm' || (ignorecase && string[i] == 'M'))
{
strmid(var, string, pos+1, i);
mins = strval(var)*60;
pos = i;
continue;
}
if(string[i] == 's' || (ignorecase && string[i] == 'S'))
{
strmid(var, string, pos+1, i);
secs = strval(var);
pos = i;
continue;
}
}
time = hours+mins+secs;
}
else if(!strcmp(type, "ymd", ignorecase)) //bsp: 5y6m12d (5 Jahre & 6 Monate & 12 Tage)
{
for (new i, l = strlen(string); i != l; i++)
{
if(string[i] == 'y' || (ignorecase && string[i] == 'Y'))
{
strmid(var, string, 0, i);
years = strval(var)*31557600;
pos = i;
continue;
}
if(string[i] == 'm' || (ignorecase && string[i] == 'M'))
{
strmid(var, string, pos+1, i);
months = strval(var)*2629800;
pos = i;
continue;
}
if(string[i] == 'd' || (ignorecase && string[i] == 'D'))
{
strmid(var, string, pos+1, i);
days = strval(var)*86400;
pos = i;
continue;
}
}
time = years+months+days;
}
return time;
}Verwendung:
printf("%d", GetSecondsByTimeString("5h30m15s"));
printf("%d", GetSecondsByTimeString("5h30m"));
printf("%d", GetSecondsByTimeString("5h"));
printf("%d", GetSecondsByTimeString("5h15s"));
printf("%d", GetSecondsByTimeString("30m5h"));
printf("%d", GetSecondsByTimeString("5h30M15s"));
printf("%d", GetSecondsByTimeString("5y6m12d", "ymd"));
printf("%d", GetSecondsByTimeString("5y12d", "ymd")); -