Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:thaydan(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessageEx (playerid, COLOR_GRAD2, "Ban khong the thay dan khi tren xe!");
- return 1;
- }
- if(GetPVarInt(playerid, "IsInArena") >= 0)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong the lam dieu nay trong dau truong!");
- return 1;
- }
- if(GetPVarInt( playerid, "EventToken") != 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "Ban khong the lam dieu nay khi dang trong su kien.");
- return 1;
- }
- if(IsPlayerConnected(playerid))
- {
- if(isnull(params))
- {
- SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /thaydan [name]");
- SendClientMessageEx(playerid, COLOR_GREY, "Ten co san : deagle , mp5 , shotgun , m4 , spass12 , uzi , sniper , 9mm , ak47");
- return 1;
- }
- if(strcmp(params, "deagle", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 2, weapon, ammosd);
- if(weapon == 24 && PlayerInfo[playerid][pDan2] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- GivePlayerValidWeapon(playerid, weapon, 1);
- if(PlayerInfo[playerid][pAmmo][ 1 ] < 2)
- {
- PlayerInfo[playerid][pDan2] -= 1;
- GivePlayerAmmoEx(playerid, weapon, 7);
- ApplyAnimation(playerid, "PYTHON", "python_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Deagle ");
- SetPlayerArmedWeapon(playerid, weapon);
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "shotgun", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 3, weapon, ammosd);
- if(weapon == 25 && PlayerInfo[playerid][pDan3] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 2 ] < 2)
- {
- PlayerInfo[playerid][pDan3] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 12);
- ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Shotgun ");
- SetPlayerArmedWeapon(playerid, weapon);
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "mp5", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 4, weapon, ammosd);
- if(weapon == 29 && PlayerInfo[playerid][pDan4] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 3 ] < 2)
- {
- PlayerInfo[playerid][pDan4] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 31);
- ApplyAnimation(playerid, "PYTHON", "python_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}MP5 ");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "tec9", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 4, weapon, ammosd);
- if(weapon == 32 && PlayerInfo[playerid][pDan4] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 3 ] < 2)
- {
- PlayerInfo[playerid][pDan4] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 31);
- ApplyAnimation(playerid, "PYTHON", "python_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}TEC9 ");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "m4", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 5, weapon, ammosd);
- if(weapon == 31 && PlayerInfo[playerid][pDan6] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- GivePlayerValidWeapon(playerid, weapon, 1);
- if(PlayerInfo[playerid][pAmmo][ 4 ] < 1)
- {
- PlayerInfo[playerid][pDan6] -= 1;
- GivePlayerAmmoEx(playerid, weapon, 50);
- ApplyAnimation(playerid, "PYTHON", "python_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}M4 ");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "spass12", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 3, weapon, ammosd);
- if(weapon == 27 && PlayerInfo[playerid][pDan7] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 2 ] < 2)
- {
- PlayerInfo[playerid][pDan7] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 8);
- ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Spass12");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "ak47", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 5, weapon, ammosd);
- if(weapon == 30 && PlayerInfo[playerid][pDan5] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 4 ] < 2)
- {
- PlayerInfo[playerid][pDan5] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 31);
- ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}AK-47 ");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "sniper", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 6, weapon, ammosd);
- if(weapon == 34 && PlayerInfo[playerid][pDan9] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 5 ] < 2)
- {
- PlayerInfo[playerid][pDan9] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 12);
- ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Sniper ");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "9mm", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 2, weapon, ammosd);
- if(weapon == 22 && PlayerInfo[playerid][pDan1] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 1 ] < 2)
- {
- PlayerInfo[playerid][pDan1] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 18);
- ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}9mm ");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "Sdpistol", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 2, weapon, ammosd);
- if(weapon == 23 && PlayerInfo[playerid][pDan1] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 1 ] < 2)
- {
- PlayerInfo[playerid][pDan1] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 18);
- ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Sdpistol");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- if(strcmp(params, "uzi", true) == 0)
- {
- new weapon, ammosd;
- GetPlayerWeaponData(playerid, 4, weapon, ammosd);
- if(weapon == 28 && PlayerInfo[playerid][pDan4] > 0)
- {
- RemovePlayerWeapon(playerid, weapon);
- if(PlayerInfo[playerid][pAmmo][ 3 ] < 2)
- {
- PlayerInfo[playerid][pDan4] -= 1;
- GivePlayerValidWeapon(playerid, weapon, 0);
- GivePlayerAmmoEx(playerid, weapon, 31);
- ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
- SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Uzi, Tec9 ");
- GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
- SetPlayerArmedWeapon(playerid, weapon);
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
- }
- else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement