Hallo Brotfische,
Ich bin gerade dabei ein Selfmade FreeRoam zu Scripten.. Habe schon einiges ca. 1200 Zeilen..
Habe mal AdminCommands gemacht.. und beim Compilen kommen diese Error.. Ist Extra in einem Filterscript gemacht !! wird dan ins Gamemode übertragen sobald es funktioniert.!
public OnPlayerCommandText(playerid, cmdtext[])
{
new specplayerid;
new specvehicleid;
new string[256];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playermoney;
new tmp[256];
new cmd[256];
new giveplayerid, moneys, idx;
printf("OnPlayerCommandText(%i, %s)",playerid, cmdtext);
if(IsPlayerAdmin(playerid))
{
if(strcmp(cmdtext, "/ah", true) == 0)
{
SendClientMessage(playerid, 0xFF9900AA,"=============Admin Befehle==============");
SendClientMessage(playerid, 0xFF9900AA,"/kick /ban /freeze /unfreeze ");
SendClientMessage(playerid, 0xFF9900AA,"/getip /getping /cnn");
SendClientMessage(playerid, 0xFF9900AA,"/nrg /goto ");
return 1;
}
if (strcmp("/nrg", cmdtext, true, 10) == 0)
{
new vehicleid;
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CreateVehicle(522,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, vehicleid, 1);
return 1;
}
if(strcmp(cmd, "/kick", true) == 0)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xAA3333AA, "[Benutze]: /kick [playerid] [Grund]");
return 1;
}
giveplayerid = strval(tmp);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID && giveplayerid != playerid)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"*** %s (id %d) hat %s (id %d) gekickt!",sendername,playerid,giveplayer,giveplayerid);
SendClientMessageToAll(0xAFAFAFAA,string);
print(string);
format(string,sizeof(string),"*** Grund : %s",result);
print(string);
SendClientMessageToAll(0xAFAFAFAA,string);
Kick(giveplayerid);
return 1;
}
else
{
SendClientMessage(playerid,0xAA3333AA,"[ERROR] Du kannst dich nicht selber Kicken!");
return 1;
}
}
if(strcmp(cmd, "/cnn", true) == 0){
new dir[256];
strmid(tmp, cmdtext, 4, strlen(cmdtext));
if(!strlen(dir)) {
SendClientMessage(playerid, 0xFFFFFFAA, "Benutze: /cnn [Text]");
SendClientMessage(playerid, 0xFFFFFFAA, "Farben: /afarben");
return 1;
}
format(string, sizeof(string), " ~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~ %s",tmp);
GameTextForAll(string, 3000, 3);
return 1;
}
if(strcmp(cmd, "/ban", true) == 0)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xAA3333AA, "[Benutze]: /ban [playerid] [Grund]");
return 1;
}
giveplayerid = strval(tmp);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID && giveplayerid != playerid)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"*** %s (id %d) hat %s (id %d) gebannt!",sendername,playerid,giveplayer,giveplayerid);
SendClientMessageToAll(0xAFAFAFAA,string);
format(string,sizeof(string),"*** Grund : %s",result);
SendClientMessageToAll(0xAFAFAFAA,string);
Ban(giveplayerid);
return 1;
}
else
{
SendClientMessage(playerid,0xAA3333AA,"[ERROR] Du kannst dich nicht selber Bannen");
return 1;
}
}
if(strcmp(cmd, "/getip", true) == 0)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xAA3333AA, "[Benutze]: /getip [playerid]");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(giveplayerid))
{
new IP[256];
GetPlayerIp(giveplayerid,IP,256);
format(string,sizeof(string),"[Erfolg] Ip von %d (id %d) ist : %s",giveplayer,giveplayerid,IP);
SendClientMessage(playerid,0x33AA33AA,string);
return 1;
}
else
{
SendClientMessage(playerid,0xAA3333AA,"[ERROR] Falsche ID");
return 1;
}
}
if(strcmp(cmd, "/getping", true) == 0)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xAA3333AA, "[Benutze]: /getping [playerid]");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(giveplayerid))
{
format(string,sizeof(string),"[Erfolg] ping von %d (id %d) ist : %s",giveplayer,giveplayerid,GetPlayerPing(giveplayerid));
SendClientMessage(playerid,0x33AA33AA,string);
return 1;
}
else
{
SendClientMessage(playerid,0xAA3333AA,"[ERROR] Falsche ID");
return 1;
}
}
if(strcmp(cmd, "/freeze", true) == 0)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xAA3333AA, "[USAGE]: /freeze [playerid]]");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID)
{
TogglePlayerControllable(giveplayerid, 0);
format(string,sizeof(string),"[ADMIN CMD] %s (id %d) hat %s (id %d) gefreezt",sendername,playerid,giveplayer,giveplayerid);
SendClientMessageToAll(0xAA3333AA,string);
format(string,sizeof(string),"[SUCESS] Du wurdest gefreezed %s (id %d)",giveplayer,giveplayerid);
SendClientMessage(playerid,0x33AA33AA,string);
return 1;
}
else
{
SendClientMessage(playerid,0xAA3333AA,"[ERROR] Du kannst keine Spieler Offline Freezen");
return 1;
}
}
if(strcmp(cmd, "/unfreeze", true) == 0)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xAA3333AA, "[USAGE]: /unfreeze [playerid]]");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID)
{
TogglePlayerControllable(giveplayerid, 1);
format(string,sizeof(string),"[ADMIN CMD] %s (id %d) hat %s (id %d) defreezed",sendername,playerid,giveplayer,giveplayerid);
SendClientMessageToAll(0xAA3333AA,string);
format(string,sizeof(string),"[SUCESS] Du wurdest defreezed %s (id %d)",giveplayer,giveplayerid);
SendClientMessage(playerid,0x33AA33AA,string);
return 1;
}
else
{
SendClientMessage(playerid,0xAA3333AA,"[ERROR] Du kannst keine Spieler Offline Unfreezen");
return 1;
// Das hier ist ZEILE 335
Und mein Error:
C:\Dokumente und Einstellungen\Sezer\SelfmadeFree\admin.pwn(335) : error 030: compound statement not closed at the end of file (started at line 331)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.