Beiträge von money08

    So wie der Theard Name sagt komm ich da nicht weiter.
    Mann bekommt keine Waffe und Geld kommt nich auf Paydaygehalt dazu.
    Skripte erst seit wening Tagen ...
    Vltt kann mir da wer helfen.
    new GunOffer[MAX_PLAYERS];
    new GunPrice[MAX_PLAYERS];
    new GunTyp[MAX_PLAYERS];
    new GunAmmo[MAX_PLAYERS];
    new GunName[MAX_PLAYERS];
    new GunDealer[MAX_PLAYERS];
    ...
    if(strcmp(cmd,"/sellgun",true)==0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(SpielerInfo[playerid][sJob] != 9)
    {
    SendClientMessage(playerid,COLOR_GREY," Du bist kein Waffen Dealer");
    return 1;
    }
    new x_weapon[256],weapon[MAX_PLAYERS],ammo[MAX_PLAYERS],price[MAX_PLAYERS];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /sellgun [playerid] [waffename]");
    SendClientMessage(playerid, COLOR_GREY, "Waffen: flowers(25) sdpistol(100) eagle(150) mp5(200) shotgun(200)");
    SendClientMessage(playerid, COLOR_GREY, "Waffen: ak47(600) m4(600) rifle (600)");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    x_weapon = strtok(cmdtext, idx);
    if(!strlen(x_weapon))
    {
    SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
    SendClientMessage(playerid, COLOR_WHITE, "*** Waffen ***");
    SendClientMessage(playerid, COLOR_GREY, "FEHLER: /sellgun [playerid] [waffenname]");


    SendClientMessage(playerid, COLOR_GREY, "Waffen:
    flowers(25) knife(100) sdpistol(100) eagle(150) mp5(200)");
    SendClientMessage(playerid, COLOR_GREY, "Waffen: shotgun(200) ak47(600) m4(600) rifle(600)");
    SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
    return 1;
    }
    }


    if(strcmp(x_weapon,"knife",true) == 0) {
    if(SpielerInfo[playerid][pMats] > 99) { weapon[playerid] = 4;
    price[playerid] = 100; ammo[playerid] = 1;
    SpielerInfo[giveplayerid][pGun1] = 4; SpielerInfo[giveplayerid][pAmmo1] =
    1; } else { SendClientMessage(playerid,COLOR_GREY," Not enough
    Materials for that Weapon!"); return 1; } }
    else
    if(strcmp(x_weapon,"sdpistol",true) == 0) {
    if(SpielerInfo[playerid][pMats] > 99) { weapon[playerid] = 23;
    price[playerid] = 100; ammo[playerid] = 50;
    SpielerInfo[giveplayerid][pGun1] = 23; SpielerInfo[giveplayerid][pAmmo1]
    = 50; } else { SendClientMessage(playerid,COLOR_GREY," Not enough
    Materials for that Weapon!"); return 1; } }
    else
    if(strcmp(x_weapon,"flowers",true) == 0) {
    if(SpielerInfo[playerid][pMats] > 24) { weapon[playerid] = 14;
    price[playerid] = 25; ammo[playerid] = 1;
    SpielerInfo[giveplayerid][pGun1] = 14; SpielerInfo[giveplayerid][pAmmo1]
    = 1; } else { SendClientMessage(playerid,COLOR_GREY," Not enough
    Materials for that Weapon!"); return 1; } }
    else
    if(strcmp(x_weapon,"eagle",true) == 0) { if(SpielerInfo[playerid][pMats]
    > 199) { weapon[playerid] = 24; price[playerid] = 150;
    ammo[playerid] = 50; SpielerInfo[giveplayerid][pGun1] = 24;
    SpielerInfo[giveplayerid][pAmmo1] = 50; } else {
    SendClientMessage(playerid,COLOR_GREY," Not enough Materials for that
    Weapon!"); return 1; } }
    else
    if(strcmp(x_weapon,"mp5",true) == 0) { if(SpielerInfo[playerid][pMats]
    > 199) { weapon[playerid] = 29; price[playerid] = 200; ammo[playerid]
    = 200; SpielerInfo[giveplayerid][pGun2] = 29;
    SpielerInfo[giveplayerid][pAmmo2] = 200; } else {
    SendClientMessage(playerid,COLOR_GREY," Not enough Materials for that
    Weapon!"); return 1; } }
    else
    if(strcmp(x_weapon,"shotgun",true) == 0) {
    if(SpielerInfo[playerid][pMats] > 199) { weapon[playerid] = 25;
    price[playerid] = 200; ammo[playerid] = 50;
    SpielerInfo[giveplayerid][pGun3] = 25; SpielerInfo[giveplayerid][pAmmo3]
    = 50; } else { SendClientMessage(playerid,COLOR_GREY," Not enough
    Materials for that Weapon!"); return 1; } }
    //else
    if(strcmp(x_weapon,"spas12",true) == 0) {
    if(SpielerInfo[playerid][pMats] > 599) { weapon[playerid] = 27;
    price[playerid] = 600; ammo[playerid] = 50;
    SpielerInfo[giveplayerid][pGun2] = 27; SpielerInfo[giveplayerid][pAmmo2]
    = 50; } else { SendClientMessage(playerid,COLOR_GREY," Not enough
    Materials for that Weapon!"); return 1; } }
    else
    if(strcmp(x_weapon,"ak47",true) == 0) { if(SpielerInfo[playerid][pMats]
    > 599) { weapon[playerid] = 30; price[playerid] = 600; ammo[playerid]
    = 250; SpielerInfo[giveplayerid][pGun4] = 30;
    SpielerInfo[giveplayerid][pAmmo4] = 250; } else {
    SendClientMessage(playerid,COLOR_GREY," Not enough Materials for that
    Weapon!"); return 1; } }
    else
    if(strcmp(x_weapon,"m4",true) == 0) { if(SpielerInfo[playerid][pMats]
    > 599) { weapon[playerid] = 31; price[playerid] = 600; ammo[playerid]
    = 250; SpielerInfo[giveplayerid][pGun4] = 31;
    SpielerInfo[giveplayerid][pAmmo4] = 250; } else {
    SendClientMessage(playerid,COLOR_GREY," Not enough Materials for that
    Weapon!"); return 1; } }
    else
    if(strcmp(x_weapon,"rifle",true) == 0) { if(SpielerInfo[playerid][pMats]
    > 599) { weapon[playerid] = 33; price[playerid] = 600;
    ammo[playerid] = 50; SpielerInfo[giveplayerid][pGun5] = 33;
    SpielerInfo[giveplayerid][pAmmo5] = 50; } else {
    SendClientMessage(playerid,COLOR_GREY," Not enough Materials for that
    Weapon!"); return 1; } }
    else { SendClientMessage(playerid,COLOR_GREY," Invalid Weapon name!"); return 1; }
    if (ProxDetectorS(5.0, playerid, giveplayerid))
    {
    if(SpielerInfo[playerid][pMiserPerk] > 0)
    {
    new skill = 2 * SpielerInfo[playerid][pMiserPerk];
    new mats = price[playerid] / 100;
    price[playerid] -= (mats)*(skill);

    }

    if(giveplayerid == playerid)
    {


    format(string, sizeof(string), " Du hast dir, eine %s mit %d
    Munition, für %d verkauft.", x_weapon, ammo[playerid], price[playerid]);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    format(string, sizeof(string), "* %s gibt sich eine Waffe.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid,weapon[playerid],ammo[playerid]);
    SpielerInfo[playerid][pMats] -= price[playerid];
    }
    else
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));


    format(string, sizeof(string), " Du hast dir, eine %s mit %d
    Munition, für %d angeboten.", x_weapon, ammo[playerid],
    (price[playerid]*3));
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);


    format(string, sizeof(string), " Der Waffendealer hat dir, eine %s
    mit %d Munition, für %d angeboten ( /accept Gun ).", x_weapon,
    ammo[playerid], (price[playerid]*3));
    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
    GunOffer[playerid] = playerid;
    GunPrice[playerid] = (price[playerid]*3);
    GunAmmo[playerid] = ammo[playerid];
    GunTyp[playerid] = weapon[playerid];
    GunName[playerid] = x_weapon[playerid];
    GunDealer[giveplayerid] = giveplayerid;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Zu weit weg.");
    return 1;
    }
    }
    else
    {
    format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }
    ...
    else if(strcmp(x_job,"Gun",true) == 0)
    {
    if(GunOffer[playerid] < 999)
    {
    if(GetPlayerMoney(GunOffer[playerid]) > GunPrice[playerid])
    {
    if(SpielerInfo[GunDealer[giveplayerid]][pMats] > 150)
    {
    if(IsPlayerConnected(GunOffer[playerid]))
    {
    GetPlayerName(GunDealer[giveplayerid], GunAmmo[playerid], GunName[playerid]);
    GetPlayerName(GunOffer[playerid], GunTyp[playerid], GunPrice[playerid]);


    format(string, sizeof(string), "* Du kaufst eine %s mit %d
    Schuss für %d$ von Waffendealer Dealer %s.", GunTyp[playerid] ,
    GunAmmo[playerid], GunPrice[playerid] , GunDealer[giveplayerid]);
    SendClientMessage(playerid, COLOR_WHITE, string);


    format(string, sizeof(string), "* %s hat dir eine %s mit%d
    Schuss an %s für %d$ .", GunDealer[giveplayerid], GunTyp[playerid],
    GunAmmo[playerid] ,GunOffer[playerid], GunPrice[playerid]);
    SendClientMessage(GunOffer[playerid], COLOR_WHITE, string);
    SpielerInfo[GunDealer[giveplayerid]][pJobGehalt] += GunPrice[playerid]* 3;
    PlayerMoney[playerid] = PlayerMoney[playerid]-(GunPrice[playerid]*3);
    GivePlayerWeapon(playerid,GunName[playerid],GunAmmo[playerid]);
    SpielerInfo[playerid][pMats] -= GunPrice[playerid];
    GunOffer[playerid] = 999;
    GunPrice[playerid] = 0;
    return 1;
    }
    return 1;
    }
    else
    {
    SendClientMessage(giveplayerid, COLOR_GREY, " Nicht genügent Mats !");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Nicht genügent Geld !");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Kein Angebot vorhanden !");
    return 1;
    }
    }