21.10.2011, 10:57
At the end
pawn Код:
if(strcmp(item, "weapon") == 0)
{
if(amount == 1) {
if(CarInfo[car][vGun1] == 0) return SendClientMessage(playerid, COLOR_GREY, "* No weapon in Slot 1.");
format(string, sizeof(string), "* %s takes a weapon from their car.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new gunid = CarInfo[car][vGun1];
CarInfo[car][vGun1] = 0;
GivePlayerGun(playerid, gunid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You taken a weapon from Slot 1.");
}
if(amount == 2) {
if(CarInfo[car][vGun2] == 0) return SendClientMessage(playerid, COLOR_GREY, "* No weapon in Slot 2.");
format(string, sizeof(string), "* %s takes a weapon from their car.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new gunid = CarInfo[car][vGun2];
CarInfo[car][vGun2] = 0;
GivePlayerGun(playerid, gunid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You taken a weapon from Slot 2.");
}
if(amount == 3) {
if(CarInfo[car][vGun3] == 0) return SendClientMessage(playerid, COLOR_GREY, "* No weapon in Slot 3.");
format(string, sizeof(string), "* %s takes a weapon from their car.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new gunid = CarInfo[car][vGun3];
CarInfo[car][vGun3] = 0;
GivePlayerGun(playerid, gunid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You taken a weapon from Slot 3.");
}
else {
SendClientMessage(playerid, COLOR_GREY, "* Usuage: /car get weapon [1 2 or 3]");
return 1;
}
else return SendClientMessage(playerid, COLOR_GRAD3, "* Syntax: Get - cash pot crack mats weapon");
}
else return SendClientMessage(playerid, COLOR_GREY, "* Invalid syntax !");
return 1;
}