Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Useful Commands by Dominik.
- 1.
- F:Was ist dieses FilterScript
- A: Einige Pawn Funktion sind Ingame ausführbar.
- CreateVehicle, Create3DTextLabel, RepairVehicle usw ...
- Das ganze ist natürlich noch nicht annähernd fertig, da ich erst eine Katergorie (Vehicles) gemacht habe.
- Im laufe der Zeit werden Viele Updates Folgen.
- 2.
- F: Darf ich dieses Filterscript editieren?
- A: Ja,
- Solange du die Credits und Copyrights nicht entferntst ist es OK.
- 3.
- F: Darf ich dieses Filterscript verkaufen?
- A: Nein,
- Es wurde kostenlos bereit gestellt und soll von niemandem verkauft werden!
- Befehle:
- /uccredits
- /SendPlayerMessageToPlayer [playerid][text]
- /Create3DTextLabel [text][distance]
- /CreateVehicle [vehicleid][color1][color2]
- /DestroyVehicle [vehicleid]
- /AddVehicleComponent [vehicleid][component]
- /RemoveVehicleComponent [vehicleid][component]
- /ChangeVehicleColor [vehicleid][color1][color2]
- /ChangeVehiclePaintJob [vehicleid][paintjob]
- /GetPlayerVehicleid [playerid]
- /GetVehicleHealth [vehicleid]
- /GetVehiclePos [vehicleid]
- /GetVehicleVirtualWorld [vehicleid]
- /GetVehicleZAngle [vehicleid]
- /RemovePlayerFromVehicle [vehicleid]
- /AttachTrailerToVehicle [trailerid][vehicleid]
- /DetachTrailerFromVehicle [trailerid][vehicleid]
- /GetVehicleDamageStatus [vehicleid]
- /LinkVehicleToInterior [vehicleid][interior]
- /PutPlayerInVehicle [playerid][vehicleid][sitz]
- /RepairVehicle [vehicleid]
- /PlayerSpectateVehicle [playerid][vehicleid]
- /SetVehicleToRespawn [vehicleid]
- /SetVehicleVelocity [vehicleid][x][y][z]
- /SetVehicleVirtualWorld [vehicleid][virtualworld]
- /SetVehicleZAngle [vehicleid][zangle]
- Update 1:
- /GetPlayerArmour [playerid]
- /GivePlayerArmour [playerid][anzahl]
- /SetPlayerArmour [playerid][anzahl]
- /GameTextForAll [text][zeit][schriftart]
- /GameTextForPlayer [playerid][text][zeit][schriftart]
- /GangZoneCreate [minx][miny][maxx][maxy]
- /GetMaxPlayers []
- /GetNetworkStats []
- /GetObjectPos [objectid]
- /SetObjectPos [objectid][x][y][z]
- /GetObjectRot [objectid]
- /SetObjectRot [objectid][x][y][z]
- /GetPlayerAmmo [playerid]
- /SetPlayerAmmo [playerid][weaponid][muni]
- /GetPlayerColor [playerid]
- */
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #if defined FILTERSCRIPT
- //Farben
- #define GRÜN 0x23FF00FF
- #define ROT 0xE10000FF
- #define ORANGE 0xFF8200FF
- #define SCHWARZ 0x141414FF
- #define WEISS 0xFFFFFFFF
- #define TRANSPARENT 0xB0C4DEFF
- #define BLAU 0x0A00FFFF
- //-----------
- native IsValidVehicle(vehicleid);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" UsefulCommands by Dominik. loaded ...");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #endif
- //Befehle
- CMD:uccredits(playerid)
- {
- SendClientMessage(playerid,ORANGE,"|===============|Credits|===============|");
- SendClientMessage(playerid,WEISS, "Dominik.: Scripting");
- SendClientMessage(playerid,WEISS, "Zeex: zcmd");
- SendClientMessage(playerid,WEISS, "SA:MP Team: Wiki & a_samp");
- SendClientMessage(playerid,WEISS, "BlackAce: Problemlösung");
- SendClientMessage(playerid,WEISS, "Alex \"Y_Less\" Cole: sscanf");
- SendClientMessage(playerid,ORANGE,"|===============|Credits|===============|");
- return 1;
- }
- CMD:SendPlayerMessageToPlayer(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new giveplayerid;
- new playertext[128];
- if(sscanf(params,"us",giveplayerid,playertext)) return SendClientMessage(playerid,ROT,"Verwendung: /SendPlayerMessageToPlayer [playerid][text]");
- if(IsPlayerConnected(giveplayerid))
- {
- new stringtogiveplayerid[150];
- new giveplayername[MAX_PLAYER_NAME];
- GetPlayerName(giveplayerid,giveplayername,sizeof(giveplayername));
- format(stringtogiveplayerid,150,"Nachricht von %s: %s",spielername(playerid),playertext);
- SendPlayerMessageToPlayer(giveplayerid,playerid,stringtogiveplayerid);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Die angegebene SpielerID ist ungültig!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:Create3DTextLabel(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new text3d[128];
- new distance;
- if(sscanf(params,"si",text3d,distance)) return SendClientMessage(playerid,ROT,"Verwendung: /Create3DTextLabel [text][distanz]");
- if(distance > 0)
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid,X,Y,Z);
- Create3DTextLabel(text3d,WEISS,X,Y,Z,distance,GetPlayerVirtualWorld(playerid));
- SendClientMessage(playerid,GRÜN,"Erfolgreich erstellt!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Die Distanz muss über 0 sein!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:CreateVehicle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid, color1, color2;
- if(sscanf(params,"ddd",vehicleid,color1,color2)) return SendClientMessage(playerid,ROT,"Verwendung: /CreateVehicle [vehicleid][color1][color2]");
- if(vehicleid > 399 || vehicleid < 612)
- {
- if(color1 < 255 || color2 < 255)
- {
- new Float:X,Float:Y,Float:Z,Float:A;
- GetPlayerPos(playerid,X,Y,Z);
- GetPlayerFacingAngle(playerid,A);
- CreateVehicle(vehicleid,X,Y,Z,A,color1,color2,-1);
- SendClientMessage(playerid,GRÜN,"Fahrzeug erfolgreich erstellt!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Eine der angegebenen Farben ist ungültig (0-255)");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige Fahrzeug ID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:DestroyVehicle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- if(sscanf(params,"d",vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /DestroyVehicle [vehicleid]");
- if(IsValidVehicle(vehicleid))
- {
- DestroyVehicle(vehicleid);
- SendClientMessage(playerid,GRÜN,"Fahrzeug erfolgreich zerstört!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:AddVehicleComponent(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- new component;
- if(sscanf(params,"dd",vehicleid,component)) return SendClientMessage(playerid,ROT,"Verwendung: /AddVehicleComponent [vehicleid][component]");
- if(IsValidVehicle(vehicleid))
- {
- AddVehicleComponent(vehicleid,component);
- SendClientMessage(playerid,GRÜN,"Fahrzeug erfolgreich modifiziert!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:RemoveVehicleComponent(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid, component;
- if(sscanf(params,"dd",vehicleid,component)) return SendClientMessage(playerid,ROT,"Verwendung: /RemoveVehicleComponent [vehicleid][component]");
- if(IsValidVehicle(vehicleid))
- {
- RemoveVehicleComponent(vehicleid,component);
- SendClientMessage(playerid,GRÜN,"Modifizierung erfolgreich entfernt!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:ChangeVehicleColor(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid,color1,color2;
- if(sscanf(params,"ddd",vehicleid,color1,color2)) return SendClientMessage(playerid,ROT,"Verwendung: /ChangeVehicleColor [vehicleid][color1][color2]");
- if(color1 < 255 || color2 < 255)
- {
- if(IsValidVehicle(vehicleid))
- {
- ChangeVehicleColor(vehicleid,color1,color2);
- SendClientMessage(playerid,GRÜN,"Farbe erfolgreich geändert!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültiger FarbCode!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:ChangeVehiclePaintJob(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new paintjob, vehicleid;
- if(sscanf(params,"dd",vehicleid,paintjob)) return SendClientMessage(playerid,ROT,"Verwendung: /ChangeVehiclePaintJob [vehicleid][paintjob]");
- if(IsValidVehicle(vehicleid))
- {
- ChangeVehiclePaintjob(vehicleid,paintjob);
- SendClientMessage(playerid,GRÜN,"Paintjob erfolgreich geändert!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetPlayerVehicleID(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new checkid;
- if(sscanf(params,"u",checkid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetPlayerVehicleID [vehicleid]");
- new string[64];
- format(string,64,"playerid %d ist derzeit im Fahrzeug mit der ID %d",checkid,GetPlayerVehicleID(checkid));
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetVehicleHealth(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- new Float:health;
- if(sscanf(params,"d",vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetVehicleHealth [vehicleid]");
- if(IsValidVehicle(vehicleid))
- {
- new string[64];
- GetVehicleHealth(vehicleid,health);
- format(string,64,"HP des Fahrzeuges %d: %d",vehicleid,health);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetVehiclePos(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- new Float:X,Float:Y,Float:Z;
- if(sscanf(params,"d",vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetVehiclePos [vehicleid]");
- if(IsValidVehicle(vehicleid))
- {
- new string[64];
- GetVehiclePos(vehicleid,X,Y,Z);
- format(string,64,"Position des Fahrzeuges %d: %0.f %0.f %0.f",vehicleid,X,Y,Z);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetVehicleVirtualWorld(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- if(sscanf(params,"d",vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetVehicleVirtualWorld [vehicleid]");
- if(IsValidVehicle(vehicleid))
- {
- new string[64];
- format(string,64,"Virtuelle Welt des Fahrzeuges %d: %d",vehicleid,GetVehicleVirtualWorld(playerid));
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetVehicleZAngle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- new Float:ZAngle;
- if(sscanf(params,"d",vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetVehicleZAngle [vehicleid]");
- if(IsValidVehicle(vehicleid))
- {
- new string[64];
- GetVehicleZAngle(vehicleid,ZAngle);
- format(string,64,"ZAngle des Fahrzeuges %d: %0.f ",vehicleid,ZAngle);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:RemovePlayerFromVehicle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new giveplayerid;
- if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid,ROT,"Verwendung: /RemovePlayerFromVehicle [playerid]");
- if(IsPlayerConnected(giveplayerid))
- {
- if(IsPlayerInAnyVehicle(giveplayerid))
- {
- new string[64];
- new giveplayername[24];
- new getstring[64];
- GetPlayerName(giveplayerid,giveplayername,24);
- format(string,64,"%s (%d) erfolgreich vom Fahrzeug entfernet!",giveplayername,giveplayerid);
- format(getstring,64,"%s (%d) hat dich aus deinem Fahrzeug geschmissen!",spielername(playerid),playerid);
- SendClientMessage(playerid,ORANGE,string);
- SendClientMessage(playerid,ROT,getstring);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Der Spieler sitzt in keinem Fahrzeug!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:AttachTrailerToVehicle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid, trailerid;
- if(sscanf(params,"dd",trailerid,vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /AttachTrailerToVehicle [trailerid][vehicleid]");
- if(IsValidVehicle(trailerid))
- {
- if(IsValidVehicle(vehicleid))
- {
- new string[64];
- format(string,64,"Du hast erfolgreich den Anhänger %d an das Fahrzeug %d gesetzt!",vehicleid,trailerid);
- AttachTrailerToVehicle(trailerid,vehicleid);
- SendClientMessage(playerid,GRÜN,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Der angegebene Anhänger existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:DetachTrailerFromVehicle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid, trailerid;
- if(sscanf(params,"dd",trailerid,vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /DetachTrailerFromVehicle [trailerid][vehicleid]");
- if(IsValidVehicle(trailerid))
- {
- if(IsValidVehicle(vehicleid))
- {
- if(IsTrailerAttachedToVehicle(vehicleid))
- {
- new string[64];
- format(string,64,"Du hast erfolgreich den Anhänger %d vom Fahrzeug %d entfernt!",vehicleid,trailerid);
- AttachTrailerToVehicle(trailerid,vehicleid);
- SendClientMessage(playerid,GRÜN,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Der Anhänger ist nicht am angegebenen Fahrzeug!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Der angegebene Anhänger existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetVehicleDamageStatus(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- new platten, tueren, lichter, reifen;
- if(sscanf(params,"d",vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetVehicleDamageStatus [vehicleid]");
- if(IsValidVehicle(vehicleid))
- {
- GetVehicleDamageStatus(vehicleid,platten,tueren,lichter,reifen);
- new string[100];
- format(string,100,"Status: [Vehicleid] : %d - [Platten] : %d - [Tueren] : %d - [Lichter] : %d - [Reifen] : %d",vehicleid,platten,tueren,lichter,reifen);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:LinkVehicleToInterior(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid,interiorid;
- if(sscanf(params,"dd",vehicleid,interiorid)) return SendClientMessage(playerid,ROT,"Verwendung: /LinkVehicleToInterior [vehicleid][interior]");
- if(IsValidVehicle(vehicleid))
- {
- if(interiorid < 19)
- {
- LinkVehicleToInterior(vehicleid,interiorid);
- SendClientMessage(playerid,GRÜN,"Fahrzeug erfolgreich in den gewünschten Interior teleportiert!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige InteriorID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:PutPlayerInVehicle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new giveplayerid,vehicleid,sitz;
- if(sscanf(params,"udd",giveplayerid,vehicleid,sitz)) return SendClientMessage(playerid,ROT,"Verwendung: /PutPlayerInVehicle [playerid][vehicleid][sitz(0-4)]");
- if(IsPlayerConnected(giveplayerid))
- {
- if(IsValidVehicle(vehicleid))
- {
- if(sitz < 5)
- {
- new string[64];
- PutPlayerInVehicle(giveplayerid,vehicleid,sitz);
- format(string,64,"Du hast ID %d erfolgreich in das Fahrzeug %d auf den Sitz %d getan!",giveplayerid,vehicleid,sitz);
- SendClientMessage(playerid,GRÜN,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Der Sitz muss zwischen 0 und 4 liegen!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:RepairVehicle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- if(sscanf(params,"d",vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /RepairVehicle [vehicleid]");
- if(IsValidVehicle(vehicleid))
- {
- RepairVehicle(vehicleid);
- SendClientMessage(playerid,GRÜN,"Fahrzeug erfolgreich repariert!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:PlayerSpectateVehicle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new giveplayerid, vehicleid;
- if(sscanf(params,"ud",giveplayerid,vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /PlayerSpectateVehicle [playerid][vehicleid]");
- if(IsPlayerConnected(giveplayerid))
- {
- if(IsValidVehicle(vehicleid))
- {
- new string[64];
- TogglePlayerSpectating(giveplayerid,1);
- PlayerSpectateVehicle(giveplayerid,vehicleid,SPECTATE_MODE_NORMAL);
- format(string,64,"ID %d beobachtet nun das Fahrzeug %d",giveplayerid,vehicleid);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:SetVehicleToRespawn(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- if(sscanf(params,"d",vehicleid)) return SendClientMessage(playerid,ROT,"Verwendung: /SetVehicleToRespawn [vehicleid]");
- if(IsValidVehicle(vehicleid))
- {
- SetVehicleToRespawn(vehicleid);
- SendClientMessage(playerid,GRÜN,"Fahrzeug erfolgreich Respawnt!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:SetVehicleVelocity(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- new Float:x,Float:y,Float:z;
- if(sscanf(params,"dfff",vehicleid,x,y,z)) return SendClientMessage(playerid,ROT,"Verwendung: /SetVehicleVelocity [vehicleid][X][Y][Z]");
- if(IsValidVehicle(vehicleid))
- {
- new string[100];
- SetVehicleVelocity(vehicleid,x,y,z);
- format(string,100,"Die Geschwindigkeit (Velocity) des Fahrzeuges %d wurde auf %0.f %0.f %0.f gesetzt!",vehicleid,x,y,z);
- SendClientMessage(playerid,ROT,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:SetVehicleVirtualWorld(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid, vw;
- if(sscanf(params,"dd",vehicleid,vw)) return SendClientMessage(playerid,ROT,"Verwendung: /SetVehicleVirtualWorld [vehicleid][virtualworld]");
- if(IsValidVehicle(vehicleid))
- {
- new string[64];
- SetVehicleVirtualWorld(vehicleid,vw);
- format(string,64,"Du hast die VirtualWorld des Fahrzeuges %d auf %d gesetzt!",vehicleid,vw);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:SetVehicleZAngle(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new vehicleid;
- new Float:ZAngle;
- if(sscanf(params,"df",vehicleid,ZAngle)) return SendClientMessage(playerid,ROT,"Verwendung: /SetVehicleZAngle [vehicleid][zangle]");
- if(IsValidVehicle(vehicleid))
- {
- new string[64];
- SetVehicleZAngle(vehicleid,ZAngle);
- format(string,64,"Neues ZAngle von Fahrzeug %d: %0.f",vehicleid,ZAngle);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Das angegebene Fahrzeug existiert nicht!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetPlayerArmour(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new getplayerid;
- if(sscanf(params,"u",getplayerid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetPlayerArmour [playerid]");
- if(IsPlayerConnected(getplayerid))
- {
- new Float:ruestung;
- new string[64];
- GetPlayerArmour(playerid,ruestung);
- format(string,64,"Ruestung von ID %d: %0.f",getplayerid,ruestung);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GivePlayerArmour(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new giveplayerid, anzahl;
- if(sscanf(params,"ud",giveplayerid,anzahl)) return SendClientMessage(playerid,ROT,"Verwendung: /GivePlayerArmour [playerid][anzahl]");
- if(IsPlayerConnected(giveplayerid))
- {
- new Float:ruestung;
- new string[64];
- SetPlayerArmour(playerid,GetPlayerArmour(playerid,ruestung) + anzahl);
- format(string,64,"Du hast ID %d %d Ruestung gegeben!",giveplayerid,ruestung);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:SetPlayerArmour(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new giveplayerid, anzahl;
- if(sscanf(params,"ud",giveplayerid,anzahl)) return SendClientMessage(playerid,ROT,"Verwendung: /SetPlayerArmour [playerid][anzahl]");
- if(IsPlayerConnected(giveplayerid))
- {
- new string[64];
- SetPlayerArmour(playerid,anzahl);
- format(string,64,"Du hast die Ruestung von ID %d auf %d gesetzt!",giveplayerid,anzahl);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GameTextForAll(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new text[64];
- new time, style;
- if(sscanf(params,"sdd",text,time,style)) return SendClientMessage(playerid,ROT,"Verwendung: /GameTextForAll [text][zeit][schriftart]");
- if(style < 7)
- {
- GameTextForAll(text,time,style);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Die Schriftart muss zwischen 0 und 6 liegen!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GameTextForPlayer(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new text[64];
- new sendplayerid,time,style;
- if(sscanf(params,"usdd",sendplayerid,text,time,style)) return SendClientMessage(playerid,ROT,"/GameTextForPlayer [playerid][text][zeit][schriftart]");
- if(IsPlayerConnected(sendplayerid))
- {
- if(style < 7)
- {
- GameTextForPlayer(sendplayerid,text,time,style);
- SendClientMessage(playerid,GRÜN,"Nachricht erfolgreich versendet!");
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Die Schriftart muss zwischen 0 und 6 liegen!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GangZoneCreate(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new minx, miny;
- new maxx, maxy;
- new string[100];
- if(sscanf(params,"ffff",minx,miny,maxx,maxy)) return SendClientMessage(playerid,ROT,"Verwendung: /GangZoneCreate [minx][miny][maxx][maxy]");
- GangZoneCreate(minx,miny,maxx,maxy);
- format(string,64,"Gangzone erstellt! [minx] = %f - [miny] = %f - [maxx] = %f - [maxy] = %f",minx,miny,maxx,maxy);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetMaxPlayers(playerid)
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[64];
- format(string,64,"Slots auf diesem Server:",GetMaxPlayers());
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetNetworkStats(playerid)
- {
- new string[401];
- GetNetworkStats(string,401);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- CMD:GetObjectPos(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new objectid;
- new Float:x,Float:y,Float:z;
- if(sscanf(params,"d",objectid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetObjectPos [objectid]");
- GetObjectPos(objectid,x,y,z);
- new string[100];
- format(string,100,"Position des Objektes %d : %f %f %f",objectid,x,y,z);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:SetObjectPos(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new objectid;
- new Float:x,Float:y,Float:z;
- if(sscanf(params,"dfff",objectid,x,y,z)) return SendClientMessage(playerid,ROT,"Verwendung: /SetObjectPos [objectid][x][y][z]");
- SetObjectPos(objectid,x,y,z);
- new string[100];
- format(string,100,"Du hast die Position des Objektes %d folgendermaßen geändert: X: %f Y: %f Z: %f",objectid,x,y,z);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetObjectRot(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new objectid;
- new Float:x,Float:y,Float:z;
- if(sscanf(params,"d",objectid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetObjectRot [objectid]");
- GetObjectRot(objectid,x,y,z);
- new string[100];
- format(string,100,"Rotation des Objektes %d : Xrotation: %f Yrotation: %f Zrotation: %f",objectid,x,y,z);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:SetObjectRot(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new objectid;
- new Float:x,Float:y,Float:z;
- if(sscanf(params,"dfff",objectid,x,y,z)) return SendClientMessage(playerid,ROT,"Verwendung: /SetObjectRot [objectid][x][y][z]");
- SetObjectRot(objectid,x,y,z);
- new string[100];
- format(string,100,"Du hast die Ratation des Objektes %d folgendermaßen geändert: RotX: %f RotY: %f RotZ: %f",objectid,x,y,z);
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetPlayerAmmo(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new getplayerid;
- if(sscanf(params,"d",getplayerid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetPlayerAmmo [playerid]");
- if(IsPlayerConnected(getplayerid))
- {
- new string[100];
- format(string,100,"Munition der derzeitigen Waffe der SpielerID %d: %d",getplayerid,GetPlayerAmmo(playerid));
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:SetPlayerAmmo(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new setplayerid, weaponid, muni;
- if(sscanf(params,"udd",setplayerid,weaponid,muni)) return SendClientMessage(playerid,ROT,"Verwendung: /SetPlayerAmmo [playerid][weaponid][muni]");
- if(IsPlayerConnected(setplayerid))
- {
- if(weaponid < 47)
- {
- new string[64];
- SetPlayerAmmo(setplayerid,weaponid,muni);
- format(string,64,"Du hast der SpielerID %d erfolgreich die Munition der Waffe %d auf %d gesetzt!",setplayerid,weaponid,muni);
- SendClientMessage(playerid,ROT,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Die WaffenID muss zwischen 0 und 46 sein!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- CMD:GetPlayerColor(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new getplayerid;
- if(sscanf(params,"u",getplayerid)) return SendClientMessage(playerid,ROT,"Verwendung: /GetPlayerColor [playerid]");
- if(IsPlayerConnected(getplayerid))
- {
- new string[64];
- format(string,64,"Dies ist die Farbe von ID %d: %s",getplayerid,GetPlayerColor(getplayerid));
- SendClientMessage(playerid,ORANGE,string);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Ungültige SpielerID!");
- }
- }
- else
- {
- return SendClientMessage(playerid,ROT,"Du bist kein Administrator!");
- }
- }
- stock spielername(playerid)
- {
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- return playername;
- }
- stock sscanf(string[], format[], {Float,_}:...)
- {
- #if defined isnull
- if (isnull(string))
- #else
- if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
- #endif
- {
- return format[0];
- }
- #pragma tabsize 4
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs(),
- delim = ' ';
- while (string[stringPos] && string[stringPos] <= ' ')
- {
- stringPos++;
- }
- while (paramPos < paramCount && string[stringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = string[++stringPos];
- }
- do
- {
- stringPos++;
- if ('0' <= ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return -1;
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- num = 0,
- ch = string[stringPos];
- do
- {
- stringPos++;
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- default:
- {
- return -1;
- }
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- new changestr[16], changepos = 0, strpos = stringPos;
- while(changepos < 16 && string[strpos] && string[strpos] != delim)
- {
- changestr[changepos++] = string[strpos++];
- }
- changestr[changepos] = '\0';
- setarg(paramPos,0,_:floatstr(changestr));
- }
- case 'p':
- {
- delim = format[formatPos++];
- continue;
- }
- case '\'':
- {
- new
- end = formatPos - 1,
- ch;
- while ((ch = format[++end]) && ch != '\'') {}
- if (!ch)
- {
- return -1;
- }
- format[end] = '\0';
- if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
- {
- if (format[end + 1])
- {
- return -1;
- }
- return 0;
- }
- format[end] = '\'';
- stringPos = ch + (end - formatPos);
- formatPos = end + 1;
- }
- case 'u':
- {
- new
- end = stringPos - 1,
- id = 0,
- bool:num = true,
- ch;
- while ((ch = string[++end]) && ch != delim)
- {
- if (num)
- {
- if ('0' <= ch <= '9')
- {
- id = (id * 10) + (ch - '0');
- }
- else
- {
- num = false;
- }
- }
- }
- if (num && IsPlayerConnected(id))
- {
- setarg(paramPos, 0, id);
- }
- else
- {
- #if !defined foreach
- #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
- #define __SSCANF_FOREACH__
- #endif
- string[end] = '\0';
- num = false;
- new
- name[MAX_PLAYER_NAME];
- id = end - stringPos;
- foreach (Player, playerid)
- {
- GetPlayerName(playerid, name, sizeof (name));
- if (!strcmp(name, string[stringPos], true, id))
- {
- setarg(paramPos, 0, playerid);
- num = true;
- break;
- }
- }
- if (!num)
- {
- setarg(paramPos, 0, INVALID_PLAYER_ID);
- }
- string[end] = ch;
- #if defined __SSCANF_FOREACH__
- #undef foreach
- #undef __SSCANF_FOREACH__
- #endif
- }
- stringPos = end;
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = string[stringPos++]) && ch != delim)
- {
- setarg(paramPos, i++, ch);
- }
- if (!i)
- {
- return -1;
- }
- }
- else
- {
- while ((ch = string[stringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
- {
- stringPos++;
- }
- while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
- {
- stringPos++;
- }
- paramPos++;
- }
- do
- {
- if ((delim = format[formatPos++]) > ' ')
- {
- if (delim == '\'')
- {
- while ((delim = format[formatPos++]) && delim != '\'') {}
- }
- else if (delim != 'z')
- {
- return delim;
- }
- }
- }
- while (delim > ' ');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement