pawn Код:
CMD:kask(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(AracMotorsa(vehicleid))
{
if(KaskTakili[playerid] == 0)
{
SetPlayerAttachedObject(playerid, 1, 18977, 2, 0.07, 0, 0, 88, 75, 0);
new string[256];
GetPlayerName(playerid, string,sizeof(string));
format(string,sizeof(string),"*%s kaskını takar.",string);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
KaskTakili[playerid] = 1;
}
else
{
RemovePlayerAttachedObject(playerid, 1);
new string[256];
GetPlayerName(playerid, string,sizeof(string));
format(string,sizeof(string),"*%s kaskını зıkartır.",string);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
KaskTakili[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_YELLOW2, "{FF0000}(( {00FF00}[HATA]: {FFFFFF}Bu komut sadece motorlarda ve bisikletlerde зalışır. {FF0000} ))");
}
return 1;
}
This is the command and this is "AracMotorsa" callback:
pawn Код:
forward AracMotorsa(vehicleid);
public AracMotorsa(vehicleid)
{
new a = GetVehicleModel(vehicleid);
if (a == 509 || a == 481 || a == 510 || a == 462 ||a == 448 || a == 581 || a == 522 || a == 461 || a == 521 || a == 523 || a == 463 || a == 586 || a == 468 || a == 471)
{
return 1;
}
return 0;
}
And yeah, I want to attach a toy to the player's head when he does the command, and it actually does but disappears immediately after it appears.