Jump to content

Question

Posted

Salu, cand dau /spawnweapon doresc sa numai pun si numarul de gloante, vreau sa imi puna gloante infinite, aveti comanda aici:

YCMD:spawnweapon(playerid, params[], help) {
    if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_WHITE, AdminOnly);
    new id,gun,ammo,string[100],sendername[30],giveplayer[30];
    if(sscanf(params, "uii",id,gun,ammo)) return SCM(playerid,COLOR_GREY, "Sintaxa: {FFFFFF}/spawnweapon <Nume/ID> <Weapon ID> <Gloante>");
    if(gun < 1||gun > 46||gun==19||gun==20||gun==21||gun==45) return SCM(playerid,COLOR_WHITE,"Invalid weapond ID.");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
    if(PlayerInfo[id][pGunLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu are licenta de arme.");
    ServerWeapon(id, gun, ammo);
    GetPlayerName(id, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new gunname[32];
    GetWeaponName(gun, gunname, 32);
    format(string, sizeof(string), "({FF0000}Admin Info{FFFFFF}) %s i-a dat lui %s arma %s (%d ammo).",sendername,giveplayer,gunname, ammo);
    if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_WHITE, string,3);
    if(GetPlayerState(id) == PLAYER_STATE_PASSENGER) {
        new gun2,tmp;
        GetPlayerWeaponData(id,5,gun2,tmp);
        #pragma unused tmp
        if(gun2)SetPlayerArmedWeapon(id,gun2);
        else SetPlayerArmedWeapon(id,0);
    }
    return 1;
}

3 answers to this question

Recommended Posts

  • 0
Posted

YCMD:spawnweapon(playerid, params[], help) {
    if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_WHITE, AdminOnly);
    new id,gun,string[100],sendername[30],giveplayer[30];
    if(sscanf(params, "uii",id,gun)) return SCM(playerid,COLOR_GREY, "Sintaxa: {FFFFFF}/spawnweapon <Nume/ID> <Weapon ID> ");
    if(gun < 1||gun > 46||gun==19||gun==20||gun==21||gun==45) return SCM(playerid,COLOR_WHITE,"Invalid weapond ID.");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
    if(PlayerInfo[id][pGunLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu are licenta de arme.");
    ServerWeapon(id, gun, 99999);
    GetPlayerName(id, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new gunname[32];
    GetWeaponName(gun, gunname, 32);
    format(string, sizeof(string), "({FF0000}Admin Info{FFFFFF}) %s i-a dat lui %s arma %s (%d ammo).",sendername,giveplayer,gunname, ammo);
    if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_WHITE, string,3);
    if(GetPlayerState(id) == PLAYER_STATE_PASSENGER) {
        new gun2,tmp;
        GetPlayerWeaponData(id,5,gun2,tmp);
        #pragma unused tmp
        if(gun2)SetPlayerArmedWeapon(id,gun2);
        else SetPlayerArmedWeapon(id,0);
    }
    return 1;
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.