Hallo, seit ich ein Motorsystem eingebaut spinnt auf einmal mein /stats befehl.
Wo ich denn Motorsystem noch nicht drine hatte ging aber alles.. bin jetzt verwirrt.
Errors:
Selfmade.pwn(517) : error 017: undefined symbol "sSpieler"
Selfmade.pwn(517) : warning 215: expression has no effect
Selfmade.pwn(517) : error 001: expected token: ";", but found "]"
Selfmade.pwn(517) : error 029: invalid expression, assumed zero
Selfmade.pwn(517) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Alles anzeigen
Zeile:
format(string,sizeof(string)," Dein Name: %s \n Dein Level: %d\n Dein Geld: %d\n Deine Fraktion: %s\n Dein Rank: %s\n\n Dein Adminlevel: %s",name,sSpieler[playerid][Level],sSpieler[playerid][Geld],GetFraktionsName(playerid),sSpieler[playerid][Rang],GetAdminLevel(playerid));
Zeile in ganzen:
if(strcmp(cmdtext,"/stats",true)==0)
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string)," Dein Name: %s \n Dein Level: %d\n Dein Geld: %d\n Deine Fraktion: %s\n Dein Rank: %s\n\n Dein Adminlevel: %s",name,sSpieler[playerid][Level],sSpieler[playerid][Geld],GetFraktionsName(playerid),sSpieler[playerid][Rang],GetAdminLevel(playerid));
ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"Deine Statistik",string,"OK","");
return 1;
}
==Motorsystem==
oben:
forward StartEngine(playerid,vehicleid);
forward StopEngine(playerid,vehicleid);
new mengine,mlights,malarm,mdoors,mbonnet,mboot,mobjective;
new bool:Motor[MAX_VEHICLES]=false;
new motortimer[MAX_VEHICLES];
public OnVehicleSpawn:
public OnVehicleSpawn(vehicleid)
{
GetVehicleParamsEx(vehicleid,mengine,mlights,malarm,mdoors,mbonnet,mboot,mobjective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,mlights,malarm,mdoors,mbonnet,mboot,mobjective);
Motor[vehicleid] = false;
return 1;
}
public OnPlayerKeyStateChange:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_ACTION))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
new car = GetPlayerVehicleID(playerid);
if(GetVehicleModel(car) == 509 || GetVehicleModel(car) == 481 || GetVehicleModel(car) == 510)
{
SendClientMessage(playerid, ROT, "Du sitzt auf einem Fahrrad. Das hat keinen Motor!");
}
else if(Motor[car] == false)
{
SendClientMessage(playerid,COLOR_GREY,"Motor wird gestartet..");
KillTimer(motortimer[car]);
motortimer[car] = SetTimerEx("StartEngine",3000,0,"dd",playerid,car);
}
else
{
KillTimer(motortimer[car]);
motortimer[car] = SetTimerEx("StopEngine",1000,0,"dd",playerid,GetPlayerVehicleID(playerid));
}
}
}
else if (RELEASED(KEY_ACTION))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
new car = GetPlayerVehicleID(playerid);
if(Motor[car] == false)GameTextForPlayer(playerid,"~r~Abgebrochen!",500,1);
KillTimer(motortimer[car]);
}
}
return 1;
}
Und:
public StartEngine(playerid,vehicleid)
{
GetVehicleParamsEx(vehicleid,mengine,mlights,malarm,mdoors,mbonnet,mboot,mobjective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,mlights,malarm,mdoors,mbonnet,mboot,mobjective);
Motor[vehicleid] = true;
GameTextForPlayer(playerid,"~w~Motor ~g~gestartet!",100,1);
return 1;
}
public StopEngine(playerid,vehicleid)
{
GetVehicleParamsEx(vehicleid,mengine,mlights,malarm,mdoors,mbonnet,mboot,mobjective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,mlights,malarm,mdoors,mbonnet,mboot,mobjective);
Motor[vehicleid] = false;
GameTextForPlayer(playerid,"~w~Motor ~r~ausgeschalten!",100,1);
return 1;
}