Azamat_Casillas
Дебютант
Добавил в мод две команды: /hotdog и /hg. Они нормально срабатывают, но снизу выходит ошибка SERVER:Unknown Command, не выходит данная ошибка только у игрока с [0 id].
PHP:
}
if(strcmp(cmd,"/hotdog",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,411.44635010,-1778.06860352,5.07378817) || PlayerToPoint(3.0,playerid,-92.88040161,-1138.62390137,0.76093221) || PlayerToPoint(3.0,playerid,2023.54772949,1000.78607178,10.33977604) || PlayerToPoint(3.0,playerid,1523.08740234,-1675.13977051,12.84134197))// координаты ставишь свои
{
SetPlayerHealth(playerid, 100);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0,1,1,1,1);
PlayerPlaySound(playerid, 1055, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid, - 50);
GameTextForPlayer(playerid, "~r~ - 50 $", 5000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s купил хотдог, и неспеша съел его.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Здесь нельзя купить хотдог.");
return 1;
}
}
}
PHP:
}
if(strcmp("/hg", cmdtext, true, 10) == 0)
{
new weapon = GetPlayerWeapon(playerid);
new ammo = GetPlayerAmmo(playerid);
if(GetPVarInt(playerid,"Gun")>=1) {
ServerGivePlayerWeapons(playerid,GetPVarInt(playerid,"Gun"),GetPVarInt(playerid,"Ammo"));
SendClientMessage(playerid,COLOR_WHITE,"* Âû äîñòàëè ñâî¸ îðóæèå.");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s áåðåò îðóæèå â ðóêè.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
StopPlayerHoldingObject(playerid);
SetPVarInt(playerid, "Gun", 0);
SetPVarInt(playerid, "Ammo", 0); }
else if(weapon == 22) { // Colt.45
SetPVarInt(playerid, "Gun", 22);
SetPlayerHoldingObject(playerid, 346, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_WHITE,"* Âû óáðàëè â êàáóðó Colt 45");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s óáðàë ïèñòîëåò â êàáóðó.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,22); }
else if(weapon == 23) { // Colt.45 n Aeooeoaeai
SetPVarInt(playerid, "Gun", 23);
SetPlayerHoldingObject(playerid, 347, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_WHITE,"* Âû óáðàëè â êàáóðó Colt 45 Silencer");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë òàçåð íà ïîÿñ.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,23); }
else if(weapon == 24) { // Desert Eagle
SetPVarInt(playerid, "Gun", 24);
SetPlayerHoldingObject(playerid, 348, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_WHITE,"* Âû óáðàëè â êàáóðó Desert Eagle");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s óáðàë ïèñòîëåò â êàáóðó.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,24); }
else if(weapon == 25) { // Shotgun
SetPVarInt(playerid, "Gun", 25);
SetPlayerHoldingObject(playerid, 349, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SendClientMessage(playerid,COLOR_WHITE,"* Âû ïîâåñèëè äðîáîâèê íà ïëå÷î");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë äðîáîâèê íà ïëå÷î.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,25); }
else if(weapon == 28) { // UZI
SetPVarInt(playerid, "Gun", 28);
SetPlayerHoldingObject(playerid, 352, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_WHITE,"* Âû ïîâåñèëè íà ïîÿñ UZI");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë UZI íà ïîÿñ.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,28); }
else if(weapon == 29) { // MK5
SetPVarInt(playerid, "Gun", 29);
SetPlayerHoldingObject(playerid, 353, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SendClientMessage(playerid,COLOR_WHITE,"* Âû ïîâåñèëè íà ïëå÷î MP5");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë MP5 íà ïëå÷î.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,29); }
else if(weapon == 30) { // Ak47
SetPVarInt(playerid, "Gun", 30);
SetPlayerHoldingObject(playerid, 355, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SendClientMessage(playerid,COLOR_WHITE,"* Âû ïîâåñèëè íà ïëå÷î Ak47");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë Ak47 íà ïëå÷î.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,30); }
else if(weapon == 31) { // M4A1
SetPVarInt(playerid, "Gun", 31);
SetPlayerHoldingObject(playerid, 356, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SendClientMessage(playerid,COLOR_WHITE,"* Âû ïîâåñèëè íà ïëå÷î M4");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë M4 íà ïëå÷î.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,31); }
else if(weapon == 32) { // Tech 9
SetPVarInt(playerid, "Gun", 32);
SetPlayerHoldingObject(playerid, 372, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_WHITE,"* Âû ïîâåñèëè íà ïîÿñ Tech-9");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë Tech-9 íà ïîÿñ.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,32); }
else if(weapon == 33) { // Country Rifle
SetPVarInt(playerid, "Gun", 33);
SetPlayerHoldingObject(playerid, 357, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SendClientMessage(playerid,COLOR_WHITE,"* Âû óáðàëè âèíòîâêó çà ñïèíó");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s óáðàë âèíòîâêó çà ñïèíó.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,33); }
else if(weapon == 34) { // Sniper Rifle
SetPVarInt(playerid, "Gun", 34);
SetPlayerHoldingObject(playerid, 358, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SendClientMessage(playerid,COLOR_WHITE,"* Âû óáðàëè ñíàéïåðñêóþ âèíòîâêó çà ñïèíó");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s óáðàë ñíàéïåðñêóþ âèíòîâêó çà ñïèíó.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,34); }
else if(weapon == 35) { // RPG
SetPVarInt(playerid, "Gun", 35);
SetPlayerHoldingObject(playerid, 359, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SendClientMessage(playerid,COLOR_WHITE,"* Âû ïîâåñèëè çà ñïèíó ÐÏÃ-7");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë RPG-7 çà ñïèíó.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,35); }
else if(weapon == 36) { // RPG-Automatical
SetPVarInt(playerid, "Gun", 36);
SetPlayerHoldingObject(playerid, 360, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SendClientMessage(playerid,COLOR_WHITE,"* Âû ïîâåñèëè çà ñïèíó ì136ÀÒ4");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ïîâåñèë ì136ÀÒ4 çà ñïèíó.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Ammo", ammo);
RemovePlayerWeapon(playerid,36); }
else {}
return 1;
}
