Ich habe keinen dcmd Befehl bei OnPlayerCommandText drin.
Also ich schicke jetzt hier mal mein "public OnPlayerCommandText" und meine dcmd Befehle.
-- BITTE NICHT KLAUEN --
public OnPlayerCommandText(playerid, cmdtext[])
{
//Allgemeine Befehle
if (strcmp("/stats", cmdtext, true, 10) == 0)
{
new string [128];
new ftext[20];
new level = sInfo[playerid][Fraktion];
//------------------Fraktionendefinierung------------------//
//---Staats-Fraktionen---
if(level == 0) { ftext= "Zivilist"; }
else if(level == 1) { ftext= "LSPD"; }
else if(level == 2) { ftext= "FBI"; }
else if(level == 3) { ftext= "Army"; }
else if(level == 4) { ftext= "Ambulanz"; }
else if(level == 5) { ftext= "O-Amt"; }
else if(level == 6) { ftext= "Taxi"; }
else if(level == 7) { ftext= "CNN"; }
//---Gangs/Mafien---
else if(level == 8) { ftext= "Ballas"; }
else if(level == 9) { ftext= "Groove Street"; }
else if(level == 10) { ftext= "Triaden"; }
else if(level == 11) { ftext= "La Cosa Nostra"; }
else if(level == 12) { ftext= ""; }
format(string,sizeof(string),"Name: \nFraktion: %s\n\nGeld auf der Hand: %d\nLevel: %d\nZeit seit Payday: %i Minuten",ftext,GetPlayerMoney(playerid),sInfo[playerid][Level],sInfo[playerid][Paytime]);
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Deine Statistik",string,"Weiter","Schließen");
return 1;
}
//Enter & Exit
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1555.3000488281, -1675.6999511719, 15.800000762939)) //LSPD Enter
{
SetPlayerVirtualWorld(playerid, 1);
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid,246.80000305176, 62.900001525879, 1002.515625);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1462.4000244141, -1011.5, 26.799999237061)) // Bank Enter
{
SetPlayerPos(playerid,1461.8000488281,-1009,26.89999961853);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1368.0999755859, -1279.9000244141, 13.5)) //Ammunation LS Enter
{
SetPlayerVirtualWorld(playerid, 1);
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid, 285.5, -41.700000762939, 1001.5);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1481.0999755859, -1771.5999755859, 18.799999237061)) //Stadthalle LS Enter
{
SetPlayerVirtualWorld(playerid, 1);
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 390.10000610352, 173.80000305176, 1008.4000244141);
}
return 1;
}
if (strcmp("/exit", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 246.80000305176, 62.900001525879, 1002.515625))
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1555.3000488281, -1675.6999511719, 15.800000762939);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1461.8000488281,-1009,26.89999961853)) //Bank Exit
{
SetPlayerPos(playerid,1462.4000244141, -1011.5, 26.799999237061);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 285.5, -41.700000762939, 1001.5)) //Ammunation LS Exit
{
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid, 1368.0999755859, -1279.9000244141, 13.5);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 390.10000610352, 173.80000305176, 1008.4000244141)) //Stadthalle LS Exit
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1481.0999755859, -1771.5999755859, 18.799999237061);
}
return 1;
}
//Tore & Türen
if (strcmp("/pd1", cmdtext, true, 10) == 0)
{
if(IstSpielerInFraktion(playerid,1))
{
if(IsPlayerInRangeOfPoint(playerid,2.0,250.7000000,62.3000000,1004.7000100))
{
MoveObject(pd11,250.6000100,62.6000000,1004.999987793, 2);
MoveObject(pd12,250.6000100,62.5999800,1002.6399536133, 2);
SetTimer("pd1close",3000,false);
return 1;
}
}
return 1;
}
if (strcmp("/pd2", cmdtext, true, 10) == 0)
{
if(IstSpielerInFraktion(playerid,1))
{
if(IsPlayerInRangeOfPoint(playerid,2.0,246.39999389648,72.400001525879,1003.5999755859))
{
MoveObject(pd21,246.6000100,72.5000000,1004.999987793, 2);
MoveObject(pd22,246.5996100,72.5000000,1002.6399536133, 2);
SetTimer("pd2close",3000,false);
return 1;
}
}
return 1;
}
//Shop Befehle
if (strcmp("/buy", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, 296.39999389648,-38.200000762939,1001.5)) //Ammunation LS
{
ShowPlayerDialog(playerid,DIALOG_SHOP_1,DIALOG_STYLE_LIST,"Waffenshop","Messer\nPistol","Kaufen","Schließen");
return 1;
}
return 1;
}
if (strcmp("/gmx", cmdtext, true, 10) == 0)
{
if(IstSpielerAdmin(playerid, 6))
{
SendRconCommand("gmx");
return 1;
}
else
{
SendClientMessage(playerid,Rot,"Du besitzt dafür nicht die Rechte.");
return 1;
}
}
//Teleport
if (strcmp("/gotols", cmdtext, true, 10) == 0)
{
if(IstSpielerAdmin(playerid, 2))
{
SetPlayerPos(playerid,1529.7111,-1675.6719,13.3828);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid,Gelb,"Du hast dich nach LS geportet.");
return 1;
}
return 1;
}
if (strcmp("/gotosf", cmdtext, true, 10) == 0)
{
if(IstSpielerAdmin(playerid, 2))
{
SetPlayerPos(playerid,-1415.0,-300.0,14.10000038147);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid,Gelb,"Du hast dich nach SF geportet.");
return 1;
}
return 1;
}
if (strcmp("/gotolv", cmdtext, true, 10) == 0)
{
if(IstSpielerAdmin(playerid, 2))
{
SetPlayerPos(playerid,1690.4000244141,1447.8000488281,10.800000190735);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid,Gelb,"Du hast dich nach LV geportet.");
return 1;
}
return 1;
}
//AdminCar
if (strcmp("/admincar", cmdtext, true, 10) == 0)
{
if(IstSpielerAdmin(playerid, 4))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateVehicle(573, x, y, z, 82.2873, 0, 1, -1);
return 1;
}
return 1;
}
if (strcmp("/dadmincar", cmdtext, true, 10) == 0)
{
if(IstSpielerAdmin(playerid, 4))
{
if(IsPlayerInVehicle(playerid, 573))
{
new admincar;
admincar = GetPlayerVehicleID(playerid);
DestroyVehicle(admincar);
SendClientMessage(playerid,Grün, "Du hast dein Admincar erfolgreich gelöscht/zerstört.");
return 1;
}
else
{
SendClientMessage(playerid,Rot,"Du sitz nicht in einem Admincar!");
return 1;
}
}
return 1;
}
//------Fraktionen------
//Equip
if(strcmp("/equip", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,2.0,257.7118,78.3428,1003.6406))
{
if(IstSpielerInFraktion(playerid, 1))return SendClientMessage(playerid,Rot,"Du bist nicht in dieser Fraktion!");
{
ShowPlayerDialog(playerid,DIALOG_EQUIP_LSPD,DIALOG_STYLE_LIST,"Equip","Desert Eagle\nMP5\nShotgun","Equip","Schließen");
}
}
return 1;
}
//Bank
if (strcmp("/bankmenu", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, 1461.9301,-993.0657,26.8554))
{
ShowPlayerDialog(playerid,DIALOG_BANKMENU,DIALOG_STYLE_LIST,"Bank Menü","Kontostand\nEinzahlung\nAuszahlung","Wählen","Schließen");
}
}
dcmd(makeadmin,9, cmdtext);
dcmd(kick,4, cmdtext);
dcmd(makeleader,10, cmdtext);
dcmd(givemoney,9, cmdtext);
dcmd(goto,4, cmdtext);
return 0;
}
dcmd_makeadmin(playerid, params[])
{
new pid,level;
if(sscanf(params,"ud", pid, level))
return SendClientMessage(playerid, Orange,"Verwendung: /makeadmin [ID] [Level]");
if(IstSpielerAdmin(playerid, 6))return SendClientMessage(playerid,Rot,"Du besitzt dafür nicht die Rechte.");
if(pid == INVALID_PLAYER_ID)return SendClientMessage(playerid,Rot,"Ungültiger Spieler!");
if(IstSpielerAdmin(pid,level) == level)
{
SendClientMessage(playerid,Rot,"Der Spieler hat schon den angegebenen Rang!");
return 1;
}
else
{
sInfo[pid][aLevel] = level;
SendClientMessage(pid, Hell_Blau, "Du bist nun ein Administrator!");
SendClientMessage(playerid, Hell_Blau, "Du hast den angegebenen Spieler zum Administrator gemacht.");
SendClientMessage(playerid,Rot,"Du sitz nicht in einem Admincar!");
return 1;
}
}
dcmd_kick(playerid,params[])
{
new pid, str[64];
if(sscanf(params,"uS(Kein Grund)[128]", pid, str))
return SendClientMessage(playerid, Orange,"VERWENDUNG: /kick [ID] [Grund]");
if(pid == playerid) return SendClientMessage(playerid, Rot, "Du kannst dich nicht selber kicken.");
if(pid == INVALID_PLAYER_ID) return SendClientMessage(playerid,Rot,"Ungültiger Spieler!");
if(IstSpielerAdmin(playerid, 2))
{
new Spieler[MAX_PLAYER_NAME], str2[128];
GetPlayerName(pid,Spieler,sizeof(Spieler));
format(str2,sizeof(str2),"%s wurde vom Server gekickt. Grund: %s",Spieler,str);
SendClientMessageToAll(AdminFarbe,str2);
Kick(pid);
}
else return SendClientMessage(playerid, Rot, "Du besitzt dafür nicht die Rechte.");
return 1;
}
dcmd_makeleader(playerid,params[])
{
new pid, frakid;
if(sscanf(params,"ud",pid,frakid))
{
return SendClientMessage(playerid,Orange,"VERWENDUNG: /makeleader [ID] [Fraktionsid]");
}
if(IstSpielerAdmin(playerid, 3))return SendClientMessage(playerid,Rot,"Du besitzt dafür nicht die Rechte.");
if(frakid > 7)return SendClientMessage(playerid,Rot,"Diese Fraktion gibt es nicht.");
if(pid == INVALID_PLAYER_ID)return SendClientMessage(playerid,Rot,"Ungültiger Spieler!");
if(IstSpielerInFraktion(pid,frakid) == frakid)
{
return SendClientMessage(playerid,Rot,"Der angegebene Spieler ist schon in dieser Fraktion!");
}
else
{
sInfo[pid][Fraktion] = frakid;
SendClientMessage(pid,Hell_Blau,"Du wurdest Leader der Fraktion gemacht.");
SendClientMessage(playerid,Hell_Blau,"Du den Spieler zum Leader der Fraktion gemacht.");
}
return 1;
}
dcmd_givemoney(playerid,params[])
{
new pid,betrag;
if(sscanf(params,"ud", pid, betrag))
{
return SendClientMessage(playerid, Orange,"VERWENDUNG: /givemoney [ID] [Betrag]");
}
if(IstSpielerAdmin(playerid, 3))return SendClientMessage(playerid,Rot,"Du besitzt dafür nicht die Rechte.");
if(pid == INVALID_PLAYER_ID)
{
return SendClientMessage(playerid,Rot,"Ungültiger Spieler!");
}
else
{
GivePlayerMoney(pid,betrag);
SendClientMessage(pid,Hell_Blau,"Ein Teammitglied hat dir etwas Geld geschenkt.");
SendClientMessage(playerid,Hell_Blau,"Du hast dem Spieler etwas Geld geschenkt.");
PlayerPlaySound(pid,1054,0.0,0.0,0.0);
}
return 1;
}
dcmd_goto(playerid,params[])
{
new pID, text[128];
if(IstSpielerAdmin(playerid,1)) return SendClientMessage(playerid,Rot,"Du besitzt dafür nicht die Rechte!");
if(sscanf(params,"u",pID)) return SendClientMessage(playerid,Orange,"VERWENDUNG: /goto [Spielername/ID]");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,Rot,"Der Spieler ist nicht online.");
new Float:x, Float:y, Float:z;
GetPlayerPos(pID,x,y,z);
SetPlayerPos(playerid,x+2,y,z);
new interior = GetPlayerInterior(pID);
SetPlayerInterior(playerid,interior);
return 1;
}