- เครดิต
- 773
- ความรู้
-
- เงิน $
-
- ความดี
-
|
- if(strcmp(cmd, "/ãËé»×¹", true) == 0)
- {
- if(IsPlayerConnected(playerid))
-
- {
- if(GetPlayerWeapon(playerid) != 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " ¤Ø³µéͧäÁèÍÂÙèã¹Ã¶ !");
- return 1;
- }
- new Car = GetPlayerVehicleID(playerid);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /giveweapon [playerid/PartOfName] [Ammo]");
- SendClientMessage(playerid, COLOR_LIGHTRED, "* ¤Óàµ×͹»×¹·Õè¤Ø³¨ÐãËéµéͧà»ç¹»×¹·Õè¤Ø³¨Ð¶×ÍÍÂÙèà·èÒ¹Ñé¹");
- return 1;
- }
- if(GetPlayerWeapon(playerid) != 16 && GetPlayerWeapon(playerid) != 23 && GetPlayerWeapon(playerid) != 24 && GetPlayerWeapon(playerid) != 25 && GetPlayerWeapon(playerid) != 29 && GetPlayerWeapon(playerid) != 30 && GetPlayerWeapon(playerid) != 31 && GetPlayerWeapon(playerid) != 34)
- {
- SendClientMessage(playerid, COLOR_GRAD1, " »×¹¾Ç¡¹ÕéäÁèÊÒÁÒöãËéä´é (»×¹·ÕèãËéä´é´Ùã¹ /guninfo)");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- new ammo;
- new gun[20];
- ammo = strval(tmp);
- if(ammo < 1) { SendClientMessage(playerid, COLOR_GREY, " ËéÒÁµèÓ¡ÇèÒ 1 ¹Ñ´!"); return 1; }
- if(ammo > 999) { SendClientMessage(playerid, COLOR_GREY, " ËéÒÁà¡ÔÁ 999 ¹Ñ´!"); return 1; }
- if(IsPlayerConnected(giveplayerid))
- {
- if(GetPlayerAmmo(playerid) >= ammo)
- {
- if (ProxDetectorS(3.0, playerid, giveplayerid))
- {
- if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " ¤Ø³äÁèÊÒÁÒöãËé»×¹µ¹àͧä´é!"); return 1; }
- if(!IsPlayerInVehicle(giveplayerid, Car))
- {
- if(GetPlayerWeapon(playerid) == 16) { gun = "Grenades"; }
- if(GetPlayerWeapon(playerid) == 23) { gun = "SPistol"; }
- if(GetPlayerWeapon(playerid) == 24) { gun = "Deagle"; }
- if(GetPlayerWeapon(playerid) == 25) { gun = "Shotgun"; }
- if(GetPlayerWeapon(playerid) == 29) { gun = "MP5"; }
- if(GetPlayerWeapon(playerid) == 30) { gun = "AK47"; }
- if(GetPlayerWeapon(playerid) == 31) { gun = "M4"; }
- if(GetPlayerWeapon(playerid) == 34) { gun = "Sniper"; }
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), " ¤Ø³ä´éãËé»×¹·Õè¤Ø³¶×ÍÍÂÙèá¡è %s ¨Ó¹Ç¹ %d ¹Ñ´", giveplayer, ammo);
- SendClientMessage(playerid, COLOR_GRAD1, string);
- format(string, sizeof(string), " ¤Ø³ä´éÃѺ»×¹ %s ¨Ó¹Ç¹ %d ¹Ñ´ ¨Ò¡ %s", gun, ammo, sendername);
- SendClientMessage(giveplayerid, COLOR_GRAD1, string);
- format(string, sizeof(string), "* %s ä´éãËé»×¹·Õè¶×ÍÍÂÙèá¡è %s", sendername, giveplayer);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- GivePlayerWeapon(playerid, GetPlayerWeapon(playerid),-ammo);
- GivePlayerWeapon(giveplayerid, GetPlayerWeapon(playerid), ammo);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " ¼ÙéàÅè¹¹Ñé¹ÍÂÙèã¹Ã¶äÁèÊÒÁÒöãËé»×¹ä´é !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " ¼ÙéàÅè¹¹Ñé¹äÁèä´éÍÂÙèã¡Åé¤Ø³ !");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " ¤Ø³äÁèÁÕ¡ÃÐÊعÁÒ¡¢¹Ò´¹Ñé¹ !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " ¤Ø³µéͧ¶×Í»×¹ÍÂØèà·èÒ¹Ñ鹨֧¨ÐãËéä´é !");
- }
- }//not connected
- return 1;
- }
คัดลอกไปที่คลิปบอร์ด
|
|