CallRemoteFunction Problem Bitte Helfen danke :)

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
  • hey hab ein problem mit den kaufen eines Fraktionsauto benutze das SOL script ich glaube das bei den SoL GetPlayerMoney ist guck es euch ma an immer wenn ich kaufen will steht ich hab nich genügend Geld


    CallRemoteFunction("Script_SetPlayerMoney","id",playerid,(CallRemoteFunction("Script_GetPlayerMoney","i",playerid)-FactionBuylist[fbl][fbPrice]));


    // edit Bitte Helfn^^

    Einmal editiert, zuletzt von BlueFoX™ ()

  • //AUTOHASU
    forward START_FRAC();
    public START_FRAC(){
    LoadFactionCars();
    #if defined FACTION_CARS_LOCKABLE
    FactionCarsTimer = SetTimer("LockFactionCarDoors",1037,true);
    #endif
    SaveFactionCarsTimer = SetTimerEx("SaveFactionCars",((1000*60)*15),true,"d",false);
    for(new fbl;fbl<sizeof(FactionBuylist);fbl++){
    FactionBuylist[fbl][fbCarid] = CreateVehicle(FactionBuylist[fbl][fbVehid],FactionBuylist[fbl][fbX],FactionBuylist[fbl][fbY],FactionBuylist[fbl][fbZ],FactionBuylist[fbl][fbA],-1,-1,-255);
    new fblText[128];
    format(fblText,sizeof(fblText),"|--- GangAutoHaus ---|\n\nFahrzeugname: %s\nPreis: $%d",fCarName[FactionBuylist[fbl][fbVehid]-400],FactionBuylist[fbl][fbPrice]);
    FactionBuylist[fbl][fbLabel] = Create3DTextLabel(fblText,0xFFFFFFFF,FactionBuylist[fbl][fbX],FactionBuylist[fbl][fbY],FactionBuylist[fbl][fbZ],40.0,0,true);
    Attach3DTextLabelToVehicle(FactionBuylist[fbl][fbLabel],FactionBuylist[fbl][fbCarid],0.0,0.0,0.75);
    }
    BuylistRespawner = SetTimer("RespawnFactionBuylist",(1000*60)*10,true);
    return 1;
    }
    forward STOP_FRAC();
    public STOP_FRAC()
    {
    KillTimer(SaveFactionCarsTimer);
    SaveFactionCars(true);
    #if defined FACTION_CARS_LOCKABLE
    KillTimer(FactionCarsTimer);
    #endif
    KillTimer(BuylistRespawner);
    for(new fbl;fbl<sizeof(FactionBuylist);fbl++)
    {
    DestroyVehicle(FactionBuylist[fbl][fbCarid]);
    Delete3DTextLabel(FactionBuylist[fbl][fbLabel]);
    }
    return 1;
    }
    forward FRAC_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
    public FRAC_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger){
    for(new fbl;fbl<sizeof(FactionBuylist);fbl++){
    if(vehicleid == FactionBuylist[fbl][fbCarid]){
    if(!IsAllowedFactionToBuy(GetPlayerLeader(playerid))){
    SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht brechtigt Gangautos zu kaufen!");
    new Float:pPos[3];
    GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
    SetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
    }break;
    }
    }return 1;
    }
    forward FRAC_OnVehicleDeath(vehicleid, killerid);
    public FRAC_OnVehicleDeath(vehicleid, killerid){
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(FactionCars[fc][fCarid] == vehicleid){
    SetTimerEx("DestroyAndCreateFactionCar",3000,0,"d",fc);
    break;
    }
    }
    }return 1;
    }
    forward FRAC_OnPlayerCommandText(playerid, cmdtext[]);
    public FRAC_OnPlayerCommandText(playerid, cmdtext[])
    {
    dcmd(efa,3,cmdtext);
    if(strcmp(cmdtext,"/fpark",true)==0){
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
    new fc;while(fc<sizeof(FactionCars)){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(GetPlayerVehicleID(playerid) == FactionCars[fc][fCarid]){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL || GetPlayerLeader(playerid) == FactionCars[fc][fFaction][0]){
    GetVehiclePos(FactionCars[fc][fCarid],FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2]);
    GetVehicleZAngle(FactionCars[fc][fCarid],FactionCars[fc][fPos][3]);
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast das Fraktionsfahrzeug erfolgreich umgeparkt.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist dazu nicht berechtigt.");
    return true;
    }
    }fc++;
    }SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fraktionsfahrzeug.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fahrzeug oder bist nicht der Fahrer.");
    return true;
    }
    if(strcmp(cmdtext,"/fcarsell",true)==0){
    if(GetPlayerLeader(playerid)){
    if(IsAllowedFactionToBuy(GetPlayerFaction(playerid))){
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
    new Carid1 = GetPlayerVehicleID(playerid);
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(Carid1 == FactionCars[fc][fCarid]){
    if(FactionCars[fc][fFaction][0] == GetPlayerLeader(playerid)){
    FactionCars[fc][fVehid] = -255;
    if(DestroyVehicle(FactionCars[fc][fCarid]))
    FactionCars[fc][fCarid] = -255;
    new fText[178];
    format(fText,sizeof(fText),"Du hast das Fraktionsfahrzeug erfolgreich für $%d(50%% vom Kaufpreis) verkauft.",(FactionCars[fc][fPrice]/2));
    SendClientMessage(playerid,FACTION_COL_YELLOW,fText);
    CallRemoteFunction("Script_GivePlayerMoney","id",playerid,(FactionCars[fc][fPrice]/2));
    }
    else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht der besitzer dieses Fahrzeuges.");
    return true;
    }
    }
    }SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fraktionsfahrzeug.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du musst der Fahrer eines Fahrzeuges sein.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Deine Fraktion ist dazu nicht berechtigt.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
    return true;
    }
    if(strcmp(cmdtext,"/lfa",true)==0){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL){
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    new Float:fX,Float:fY,Float:fZ;
    GetVehiclePos(FactionCars[fc][fCarid],fX,fY,fZ);
    if(IsPlayerInRangeOfPoint(playerid,4.0,fX,fY,fZ)){
    FactionCars[fc][fVehid] = -255;
    if(DestroyVehicle(FactionCars[fc][fCarid])){
    FactionCars[fc][fCarid] = -255;
    }return SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast das Fraktionsfahrzeug entfernt.");
    }
    }
    }
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
    return true;
    }
    if(strcmp(cmdtext,"/rafa",true)==0){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL){
    new fName[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid,fName,sizeof(fName));
    format(string,sizeof(string),"Server: %s hat alle Fraktionsfahrzeuge respawnt.",fName);
    SendClientMessageToAll(FACTION_COL_YELLOW,string);
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
    DestroyAndCreateFactionCar(fc);
    }
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
    return true;
    }
    if(strcmp(cmdtext,"/ramfa",true)==0){
    if(GetPlayerLeader(playerid)){
    if(gettime() < LastRespawned[GetPlayerFaction(playerid)-1])
    return SendClientMessage(playerid,FACTION_COL_GREY,"Du kannst deine Fahrzeuge nur alle '15' Minuten respawnen.");
    LastRespawned[GetPlayerFaction(playerid)-1] = gettime()+(60*15);
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(FactionCars[fc][fFaction][0] == GetPlayerFaction(playerid)){
    DestroyAndCreateFactionCar(fc);
    }
    }
    }SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast deine Fraktionsfahrzeuge erfolgreich respawnt.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
    return true;
    }
    #if defined FACTION_CARS_LOCKABLE
    if(strcmp(cmdtext,"/flock",true)==0){
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(GetPlayerVehicleID(playerid) == FactionCars[fc][fCarid]){
    for(new f;f<5;f++){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL || GetPlayerFaction(playerid) == FactionCars[fc][fFaction][f]){
    PlayerPlaySound(playerid,1145,0.0,0.0,0.0);
    if(FactionCars[fc][fLock] == true){
    FactionCars[fc][fLock] = false;
    fUnlockCar(FactionCars[fc][fCarid]);
    GameTextForPlayer(playerid,"~w~Fahrzeug~n~~g~Aufgeschlossen",5000,3);
    }
    else if(FactionCars[fc][fLock] == false){
    fLockCar(FactionCars[fc][fCarid]);
    FactionCars[fc][fLock] = true;
    GameTextForPlayer(playerid,"~w~Fahrzeug~n~~r~Abgeschlossen",5000,3);
    }break;
    }
    }return true;
    }
    }
    }SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fraktionsfahrzeug!");
    }else{
    if(GetPlayerState(playerid)==PLAYER_STATE_PASSENGER)
    SendClientMessage(playerid,FACTION_COL_GREY,"Du musst der Fahrer dieses Fahrzeuges sein.");
    else
    SendClientMessage(playerid,FACTION_COL_GREY,"Du muss in einem Fahrzeug sitzen.");
    }return true;
    }
    #endif
    return 1;
    }
    dcmd_efa(playerid,params[]){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL){
    new vehid,col1,col2,faction[5];
    if(!sscanf(params,"dddd",vehid,col1,col2,faction[0])){
    sscanf(params,"dddddddd",vehid,col1,col2,faction[0],faction[1],faction[2],faction[3],faction[4]);
    if(vehid < 400 || vehid > 611) return SendClientMessage(playerid,FACTION_COL_GREY,"Vehicle-ID nur von 400 bis 611.");
    if(col1 < 0 || col1 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(1)!");
    if(col2 < 0 || col2 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(2)!");
    if(faction[0] && faction[0] <= MAX_FACTIONS){
    for(new f;f<5;f++){
    if(faction[f] <= 0 || faction[f] > MAX_FACTIONS){
    faction[f] = -255;
    }
    }
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] < 400 || FactionCars[fc][fVehid] > 611){
    FactionCars[fc][fVehid] = vehid;
    new Float:fX,Float:fY,Float:fZ,Float:fA;
    GetPlayerPos(playerid,fX,fY,fZ),GetPlayerFacingAngle(playerid,fA);
    FactionCars[fc][fPos][0] = fX;
    FactionCars[fc][fPos][1] = fY;
    FactionCars[fc][fPos][2] = fZ;
    FactionCars[fc][fPos][3] = fA;
    FactionCars[fc][fCol][0] = col1;
    FactionCars[fc][fCol][1] = col2;
    for(new f;f<5;f++){
    FactionCars[fc][fFaction][f] = faction[f];
    }
    FactionCars[fc][fPrice] = 0;
    for(new mod;mod<14;mod++)
    FactionCars[fc][fTuning][mod] = 0;
    FactionCars[fc][fCarid] = CreateVehicle(FactionCars[fc][fVehid],FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2],FactionCars[fc][fPos][3],FactionCars[fc][fCol][0],FactionCars[fc][fCol][1],-255);
    #if defined FACTION_CARS_LOCKABLE
    FactionCars[fc][fLock] = true;
    #endif
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast das Fraktionsfahrzeug erfolgreich erstellt.");
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Vergesse es nicht mit '/fpark' umzuparken.");
    PutPlayerInVehicle(playerid,FactionCars[fc][fCarid],0);
    return true;
    }
    }SendClientMessage(playerid,FACTION_COL_GREY,"Die Maximale Anzahl von Fraktionsfahrzeugen wurde bereits erreicht.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Fraktion!");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Benutze: '/efa [Model] [Farbe(1)] [Farbe(2)] [Hauptfraktion]'.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
    return true;
    }
    forward FRAC_OnPlayerStateChange(playerid, newstate, oldstate);
    public FRAC_OnPlayerStateChange(playerid, newstate, oldstate){
    if(newstate==PLAYER_STATE_DRIVER){
    new Carid1 = GetPlayerVehicleID(playerid);
    for(new fbl;fbl<sizeof(FactionBuylist);fbl++){
    if(Carid1 == FactionBuylist[fbl][fbCarid]){
    if(IsAllowedFactionToBuy(GetPlayerLeader(playerid))){
    TogglePlayerControllable(playerid,false);
    new fblText[256];
    format(fblText,sizeof(fblText),"{FFFFFF}Möchtest du das Fahrzeug deiner Fraktion kaufen?\n\n{F3FF02}Fahrzeugname: %s\nPreis: $%d\n\n{FFFFFF}Um das Fahrzeug zu kaufen benutze den Button 'Ja', um es nicht zu kaufen den Button 'Nein'.",fCarName[FactionBuylist[fbl][fbVehid]-400],FactionBuylist[fbl][fbPrice]);
    ShowPlayerDialog(playerid,DIALOG_FACTION_CAR_BUY,DIALOG_STYLE_MSGBOX,"{FFFFFF}Fraktionsautohaus:",fblText,"Nein","Ja");
    }else{
    SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht brechtigt Fraktionsfahrzeuge zu kaufen!");
    new Float:pPos[3];
    GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
    SetPlayerPos(playerid,pPos[0]+2.5,pPos[1]+2.5,pPos[2]);
    }break;
    }
    }
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(FactionCars[fc][fCarid] == GetPlayerVehicleID(playerid)){
    for(new f;f<5;f++){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL || GetPlayerFaction(playerid) == FactionCars[fc][fFaction][f])
    return true;
    }
    SendClientMessage(playerid,FACTION_COL_GREY,"Du bestitzt für dieses Fahrzeug keine Schlüssel, du verlässt das Fahrzeug.");
    RemovePlayerFromVehicle(playerid);
    return true;
    }
    }
    }
    }return 1;
    }
    forward FRAC_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
    public FRAC_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
    if(dialogid == DIALOG_FACTION_CAR_BUY){
    if(response){
    new Float:pPos[3];
    GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
    SetPlayerPos(playerid,pPos[0]+2.5,pPos[1]+2.5,pPos[2]);
    TogglePlayerControllable(playerid,true);
    }
    if(!response){
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
    if(IsAllowedFactionToBuy(GetPlayerLeader(playerid))){
    if(GetFactioncarsOfFaction(GetPlayerLeader(playerid)) < MAX_BUY){
    new Carid1 = GetPlayerVehicleID(playerid);
    for(new fbl;fbl<sizeof(FactionBuylist);fbl++){
    if(Carid1 == FactionBuylist[fbl][fbCarid]){
    if(CallRemoteFunction("Script_GetPlayerMoney","i",playerid) >= FactionBuylist[fbl][fbPrice]){
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] < 400 || FactionCars[fc][fVehid] > 611){
    FactionCars[fc][fVehid] = FactionBuylist[fbl][fbVehid];
    FactionCars[fc][fPos][0] = FactionBuySpawn[0];
    FactionCars[fc][fPos][1] = FactionBuySpawn[1];
    FactionCars[fc][fPos][2] = FactionBuySpawn[2];
    FactionCars[fc][fPos][3] = FactionBuySpawn[3];
    new Color[2];
    GetDefaultCarColorOfFaction(GetPlayerLeader(playerid),Color[0],Color[1]);
    FactionCars[fc][fCol][0] = Color[0];
    FactionCars[fc][fCol][1] = Color[1];


    FactionCars[fc][fPrice] = FactionBuylist[fbl][fbPrice];
    for(new slot;slot<14;slot++)
    FactionCars[fc][fTuning][slot] = 0;
    FactionCars[fc][fCarid] = CreateVehicle(FactionCars[fc][fVehid],FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2],FactionCars[fc][fPos][3],FactionCars[fc][fCol][0],FactionCars[fc][fCol][1],-255);
    print(">>> Nach dem Autoerstellen!");
    #if defined FACTION_CARS_LOCKABLE
    fLockCar(FactionCars[fc][fCarid]);
    FactionCars[fc][fLocked] = true;
    #endif
    for(new f;f<5;f++)
    {
    FactionCars[fc][fFaction][f] = -255;
    }
    FactionCars[fc][fFaction][0] = GetPlayerLeader(playerid);
    PutPlayerInVehicle(playerid,FactionCars[fc][fCarid],0);
    CallRemoteFunction("GetPlayerMoney","id",playerid,(CallRemoteFunction("GetPlayerMoney","i",playerid)-FactionBuylist[fbl][fbPrice]));
    new Float:pPos[3];
    GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
    SetPlayerPos(playerid,pPos[0]+2.5,pPos[1]+2.5,pPos[2]);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Glückwunsch zum neuen Fahrzeug.");
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Bitte vergesse nicht das Fahrzeug mit: '/fpark' umzuparken.");
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Das Fahrzeug steht am Ausgabepunkt bereit!");
    return 1;
    }
    }SendClientMessage(playerid,FACTION_COL_GREY,"Die maximale Anzahl von Fraktionsfahrzeugen ist bereits erreicht.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du hast nicht genügend Geld bei dir!");
    break;
    }
    }
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Deine Fraktion hat das Limit von Fahrzeugen bereits erreicht.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht brechtigt Fraktionsfahrzeuge zu kaufen!");
    new Float:pPos[3];
    GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
    SetPlayerPos(playerid,pPos[0]+2.5,pPos[1]+2.5,pPos[2]);
    TogglePlayerControllable(playerid,true);
    }
    }return 1;
    }return 0;
    }
    forward FRAC_OnVehicleMod(playerid, vehicleid, componentid);
    public FRAC_OnVehicleMod(playerid, vehicleid, componentid){
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(FactionCars[fc][fCarid] == vehicleid){
    #if defined FACTION_CARS_TUNEABLE
    if((FactionCars[fc][fFaction][0] == GetPlayerLeader(playerid) || GetPlayerAdmin(playerid)) && IsAllowedFactionToTune(FactionCars[fc][fFaction][0]))
    FactionCars[fc][fTuning][GetVehicleComponentType(componentid)] = componentid;
    else
    SetTimerEx("RemoveComponent",3000,false,"dd",vehicleid,componentid);
    #else
    SetTimerEx("RemoveComponent",3000,false,"dd",vehicleid,componentid);
    #endif
    break;
    }
    }
    }return 1;
    }
    forward FRAC_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
    public FRAC_OnVehiclePaintjob(playerid, vehicleid, paintjobid){
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(FactionCars[fc][fCarid] == vehicleid){
    SetTimerEx("ChangePaintjob",3000,false,"dd",FactionCars[fc][fCarid],3);
    break;
    }
    }
    }return 1;
    }



    PS: das ist nur das wichtigste !