Try
PHP Code:
new weaponid = get_user_weapon(id);
message_begin(MSG_ALL, SVC_TEMPENTITY);
write_byte(TE_PLAYERATTACHMENT);
write_byte(id);
write_coord(60);
switch(weaponid)
{
case CSW_P228:
write_short(spriteY);
default:
write_short(spriteX);
}
write_short(100);
message_end();
It should work your way though unless there is an error somewhere else.