01.03.2018, 23:33
Though this is all you need
PHP код:
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[]) // if a player writes command
{
if (strcmp("/police", cmdtext, true, 7) == 0) // if a player writes /police
{
GivePlayerWeapon(playerid, 22, 10000);
GivePlayerWeapon(playerid, 3, 1);
GivePlayerWeapon(playerid, 22, 10000);
GivePlayerWeapon(playerid, 41, 10000);
return 1;
}
if (strcmp("/swat", cmdtext, true, 5) == 0) // if a player writes /swat
{
GivePlayerWeapon(playerid, 31, 10000);
GivePlayerWeapon(playerid, 27, 10000);
GivePlayerWeapon(playerid, 24, 10000);
GivePlayerWeapon(playerid, 17, 10000);
return 1;
}
if (strcmp("/ff", cmdtext, true, 3) == 0) // if a player writes /ff
{
GivePlayerWeapon(playerid, 42, 10000);
return 1;
}
if (strcmp("/whore", cmdtext, true, 6) == 0) // if a player writes /whore
{
GivePlayerWeapon(playerid, 10, 1);
GivePlayerWeapon(playerid, 11, 1);
GivePlayerWeapon(playerid, 12, 1);
GivePlayerWeapon(playerid, 13, 1);
return 1;
}
if (strcmp("/hitman", cmdtext, true, 7) == 0) // if a player writes /hitman
{
GivePlayerWeapon(playerid, 34, 10000);
return 1;
}
if (strcmp("/terrorist", cmdtext, true, 10) == 0) // if a player writes /terrorist
{
GivePlayerWeapon(playerid, 35, 10000);
GivePlayerWeapon(playerid, 8, 1);
GivePlayerWeapon(playerid, 30, 10000);
return 1;
}
if (strcmp("/maniac", cmdtext, true, 7) == 0) // if a player writes /maniac
{
GivePlayerWeapon(playerid, 9, 10000);
return 1;
}
if (strcmp("/photographer", cmdtext, true, 13) == 0) // if a player writes /photographer
{
GivePlayerWeapon(playerid, 43, 10000);
return 1;
}
return 0;
} // we ended this callback's functions.