PHP код:
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit() return print("\n- FilterScript de arma colada carregado.\n");
public OnPlayerDeath(playerid, killerid, reason){
for(new o = 0; o < MAX_PLAYER_ATTACHED_OBJECTS; o ++){
if(IsPlayerAttachedObjectSlotUsed(playerid, o)) RemovePlayerAttachedObject(playerid, o);
}
//Ao morrer, ele remove a arma colada nas costas.
return true;
}
public OnPlayerConnect(playerid){
for(new o = 0; o < MAX_PLAYER_ATTACHED_OBJECTS; o ++){
if(IsPlayerAttachedObjectSlotUsed(playerid, o)) RemovePlayerAttachedObject(playerid, o);
}
//Ao entrar no servidor, ele remove a arma colada nas costas.
return true;
}
public OnPlayerCommandText(playerid, cmdtext[]){
if(!strcmp(cmdtext, "/colocararma", true)){
// Se o jogador for igual a skin 110, irб ser um attach. Se for 112, serб outro attach.
// Agora em questгo do 'AttachedObject', й com vocк de pegar as coordenadas.
//Antes irб remover a arma colada, mas logo depois do return, irб ser inserida novamente.
for(new o = 0; o < MAX_PLAYER_ATTACHED_OBJECTS; o ++){
if(IsPlayerAttachedObjectSlotUsed(playerid, o)) RemovePlayerAttachedObject(playerid, o);
}
if(GetPlayerSkin(playerid) == 110) return SetPlayerAttachedObject(playerid, index, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ, materialcolor1, materialcolor2);
if(GetPlayerSkin(playerid) == 112) return SetPlayerAttachedObject(playerid, index, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ, materialcolor1, materialcolor2);
SendClientMessage(playerid, -1, "Vocк colocou a arma nas costas.");
return true;
}
return false;
}
#endif