Nach dem login meines Servers, kann man keine commands mehr eingeben. Kommt immer unknown command. Liegt nicht am return 1 da trotzdem nichts kommt wenn man etwas eingibt.
Vielleicht kannst Du?
- danielsoN
- Geschlossen
- Erledigt
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
-
-
Dein Pawncode?
-
public OnPlayerCommandText(playerid, cmdtext[])
{
new stringx[128];
format(stringx,sizeof(stringx),"There is no %s Command.",cmdtext);
//AFK
if(strcmp(cmdtext, "/afk", true) == 0)
{
new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
new string[128]; // Creating the string.
GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
format(string, sizeof(string), "--> %s is now AFK",pName); // This is what will send to everyone!
SendClientMessageToAll(LIGHTBROWN, string); // This is what makes the "string" send in the "COLOR_BLUE"!
GameTextForPlayer(playerid,"~w~You ~b~are ~r~AFK ~w~now!",3000,5);
TogglePlayerControllable(playerid, 0); // Makes it so the player cannot move.
SetPlayerHealth(playerid, 999999.999); // Sets the players health so he is invincible! So noone can kill him.
return 1;
}
//BACK
if(strcmp(cmdtext, "/back", true) == 0)
{
new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
new string[128]; // Creating the string.
GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
format(string, sizeof(string), "--> %s is now BACK",pName); // This is what will send to everyone!
SendClientMessageToAll(LIGHTBROWN, string); // This is what makes the "string" send in the "COLOR_BLUE"!
GameTextForPlayer(playerid,"~w~You ~b~are ~r~BACK ~w~now!",3000,5);
TogglePlayerControllable(playerid, 1); // Makes it so the player can move.
SetPlayerHealth(playerid, 100); // Sets the players health back to normal. He is now killable.
return 1;
}
//Turn lights on
if(strcmp(cmdtext, "/lights on",true)==0)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
return 1;
}
return 1;
}
//Turn off lights
if(strcmp(cmdtext, "/lights off",true)==0)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
return 1;
}
return 1;
}
//StartEngine
if(strcmp(cmdtext, "/start engine",true)==0)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
return 1;
}
return 1;
}
//Turn off Engine
if(strcmp(cmdtext, "/stop engine",true)==0)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
return 1;
}
return 1;
}
if(strcmp(cmdtext, "/buy phone",true)==0)
{
if(IsPlayerInRangeOfPoint(playerid,1,-2235.3987,130.1578,1035.4141))
{
return 1;
}
else
{
SendClientMessage(playerid, 0xAF2800FF,"You have to stand in the pickup");
}
return 1;
}
if(strcmp(cmdtext, "/stats", true) == 0) // unser Command, kann natürlich auch anders angeordnet sein jenachdem wie er bei euch im Script definiert ist!
{
MyDialogStatsSystem(playerid); // Öffnet unsere Stats :5
return 1;
}
if(strcmp(cmdtext,"/jobs",true)==0)
{
if(IsPlayerInRangeOfPoint(playerid,1,2308.8784,-2.1824,26.7422))
{
SendClientMessage(playerid,DARKGREEN,"Will come soon..");
return 1;
}
else
{
SendClientMessage(playerid, 0xAF2800FF,"You have to stand in the pickup");
}
return 1;
}
if(strcmp(cmdtext,"/score5",true)==0)
{
SetPlayerScore(playerid,5); //Um level zu setzen
return 1;
}
if(strcmp(cmdtext,"/dslsopen",true)==0)
{
MoveObject(dslsc, 2846.50195312,-1974.86914062,3.60267448, 2); //object(elecfence_bar) (7)
SendClientMessage(playerid, WHITE,"You've {FF0000}opened {FAFAFA}the gate!");
return 1;
}
if(strcmp(cmdtext,"/dslsclose",true)==0)
{
MoveObject(dslsc, 2846.50195312,-1974.86962891,10.10267448, 2);
SendClientMessage(playerid, WHITE,"You've {FF0000}closed {FAFAFA}the gate!");
return 1;
}
if(strcmp(cmdtext,"/test",true)==0)
{
SendClientMessage(playerid,ORANGE,"This command will give you {FF0000}$500 & -60HP");
a_GivePlayerMoney(playerid, 500);
SetPlayerHealth(playerid, 10.0);
return 1;
}
if(strcmp(cmdtext,"/help",true)==0)
{
SendClientMessage(playerid,ORANGE,"|________HELP________|");
SendClientMessage(playerid,ORANGE,"** MAIN ** {FF0000}/about /score5 /afk /back");
SendClientMessage(playerid,ORANGE,"** FUN ** {FF0000}/test /dslsclose /dslsopen");
SendClientMessage(playerid,ORANGE,"** CAR ** {FF0000}/start engine /stop engine /lights on /lights off");
SendClientMessage(playerid,ORANGE,"|____________________|");
return 1;
}
if(strcmp(cmdtext,"/about",true)==0)
{
SendClientMessage(playerid,ORANGE,"|________ABOUT________|");
SendClientMessage(playerid,WHITE,"Crossfire Roleplay Server 0.3c");
SendClientMessage(playerid,WHITE,"Script: CF-RP v0.1 by ScoOf");
SendClientMessage(playerid,WHITE,"Server location: Germany");
SendClientMessage(playerid,WHITE,"mIRC: #crossfire");
SendClientMessage(playerid,ORANGE,"|_____________________|");
return 1;
}
return SendClientMessage(playerid,0x9362A3FF,stringx);
}//Edit habe noch den fehler, was heißt der? "invalid expression, assumed zero"
-
breadfish.de
Hat das Thema geschlossen.