Sziasztok!
2 dologgal egyszerûen nem boldugulok... :S
1./motor parancs....
2.Benzin bar...
1.
if(!strcmp(cmd, \"/motor\", true))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInVehicle(playerid, PlayerInfo[playerid][pPcarkey]) || IsPlayerInVehicle(playerid, PlayerInfo[playerid][pPcarkey2]))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
new playerveh = GetPlayerVehicleID(playerid);
if(CanTurnEngine[playerid] != playerveh && CanTurnEngine[playerid] == 9999)
return SendClientMessage(playerid, COLOR_GREY,\"* Mit akarsz beindítani?!\");
PutPlayerInVehicle(playerid, playerveh, 0);
engineOn[GetPlayerVehicleID(playerid)] = true;
SendClientMessage(playerid,COLOR_LIGHTGREEN,\"PiwRPG: Beindul....\");
format(string, sizeof(string), \"*Valaki elfordítja a kulcsot.\");
SetTimerEx(\"StartingTheVehicle\",3500,0,\"i\",playerid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), \"(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine\",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}
if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsADrugHarvest(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
TogglePlayerControllable(playerid, 0);
engineOn[GetPlayerVehicleID(playerid)] = false;
TogglePlayerControllable(playerid, false);
format(string, sizeof(string), \"*Valaki leálltija jármûvét.\");
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), \"(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine\",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}
}
}
return 1;
}
}
ez a parancs...
Hibám:Amikor beülök mondjuk egy Cabbieba ki írja hogy a motor beindításához írd be /motor
beírom és nem történik semmi.
Kérdés:Miért? Hogy javítom? Plz Pontosan írjatok le miért rossz :S
2.
Van egy fasza kis Benzin barom ami elvileg mérné a benzint
de 100/100% van és nem megy se fel se le.....
if(gGas == 1)
{
new vehicle = GetPlayerVehicleID(i);
if(IsModelAPlane(vehicle) || IsModelABoat(vehicle) || IsModelABycicle(vehicle) || IsADrugHarvest(vehicle) || IsAHarvest(vehicle) || IsModelAHeli(vehicle))
{
format(string, sizeof(string), \"~w~Benzin: ~g~~h~--\");
}
else if(vehicle >= 1698)
{
format(string, sizeof(string), \"~w~Benzin: ~p~Ismeretlen\");
}
else
{
if(Gas[vehicle] > 10)
{
format(string, sizeof(string), \"~w~Benzin: ~g~~h~%d/~w~100%.\",Gas[vehicle]);
}
else
{
format(string, sizeof(string), \"~w~Benzin: ~r~~h~%d/~w~100%.\",Gas[vehicle]);
}
}
TextDrawSetString(Textdraw40, string);
}
}
ez van a
public SetPlayerFree(playerid,declare,reason[])
alatt...
miért rossz?
és hogy javítom?
a TextDraw:
Textdraw40[playerid] = TextDrawCreate(498.000000, 140.000000, \" \"); // benzinem
TextDrawBackgroundColor(Textdraw40[playerid], 255);
TextDrawFont(Textdraw40[playerid], 1);
TextDrawLetterSize(Textdraw40[playerid], 0.389999, 1.299999);
TextDrawColor(Textdraw40[playerid], 0xFFFFFFFF);
TextDrawSetOutline(Textdraw40[playerid], 1);
TextDrawSetProportional(Textdraw40[playerid], 1);